• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision4aae6e5abddb84e1225cfd696b8fd2c6832f9fb6 (tree)
l'heure2018-08-04 01:08:11
AuteurNick Clifton <nickc@redh...>
CommiterNick Clifton

Message de Log

Improve objcopy's ability to merge build notes.

* objcopy.c (merge_gnu_build_notes): Delete empty notes. Merge
identical function notes.

Change Summary

Modification

--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
1+2018-08-03 Nick Clifton <nickc@redhat.com>
2+
3+ * objcopy.c (merge_gnu_build_notes): Delete empty notes. Merge
4+ identical function notes.
5+
16 2018-08-01 Nick Clifton <nickc@redhat.com>
27
38 * README-how-to-make-a-release: Add note about regenerating the
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -2177,7 +2177,7 @@ merge_gnu_build_notes (bfd * abfd, asection * sec, bfd_size_type size, bfd_byte
21772177 3. Eliminate any NT_GNU_BUILD_ATTRIBUTE_OPEN notes that have the same
21782178 full name field as the immediately preceeding note with the same type
21792179 of name and whose address ranges coincide.
2180- IE - it there are gaps in the coverage of the notes, then these gaps
2180+ IE - if there are gaps in the coverage of the notes, then these gaps
21812181 must be preserved.
21822182 4. Combine the numeric value of any NT_GNU_BUILD_ATTRIBUTE_OPEN notes
21832183 of type GNU_BUILD_ATTRIBUTE_STACK_SIZE.
@@ -2185,16 +2185,48 @@ merge_gnu_build_notes (bfd * abfd, asection * sec, bfd_size_type size, bfd_byte
21852185 its description field is empty then the nearest preceeding OPEN note
21862186 with a non-empty description field must also be preserved *OR* the
21872187 description field of the note must be changed to contain the starting
2188- address to which it refers. */
2188+ address to which it refers.
2189+ 6. Notes with the same start and end address can be deleted. */
21892190 for (pnote = pnotes + 1; pnote < pnotes_end; pnote ++)
21902191 {
21912192 int note_type;
21922193 objcopy_internal_note * back;
21932194 objcopy_internal_note * prev_open_with_range = NULL;
21942195
2196+ /* Rule 6 - delete 0-range notes. */
2197+ if (pnote->start == pnote->end)
2198+ {
2199+ duplicate_found = TRUE;
2200+ pnote->note.type = 0;
2201+ continue;
2202+ }
2203+
21952204 /* Rule 2 - preserve function notes. */
21962205 if (! is_open_note (pnote))
2197- continue;
2206+ {
2207+ int iter;
2208+
2209+ /* Check to see if there is an identical previous function note.
2210+ This can happen with overlays for example. */
2211+ for (iter = 0, back = pnote -1; back >= pnotes; back --)
2212+ {
2213+ if (back->start == pnote->start
2214+ && back->end == pnote->end
2215+ && back->note.namesz == pnote->note.namesz
2216+ && memcmp (back->note.namedata, pnote->note.namedata, pnote->note.namesz) == 0)
2217+ {
2218+ fprintf (stderr, "DUP FUNXC\n");
2219+ duplicate_found = TRUE;
2220+ pnote->note.type = 0;
2221+ break;
2222+ }
2223+
2224+ /* Don't scan too far back however. */
2225+ if (iter ++ > 16)
2226+ break;
2227+ }
2228+ continue;
2229+ }
21982230
21992231 note_type = pnote->note.namedata[attribute_type_byte];
22002232