Commit 5c49f2cd authored by Nick Clifton's avatar Nick Clifton
Browse files

Improve objcopy's note mergeing capabilities.

	* objcopy.c (struct merged_note_section): New structure.  Used to
	chain together details of mergeable note sections.
	(is_merged_note_section): Rename to is_megreable_note_section and
	return true for note sections that use GNU_BUILD_ATTRS_SECTION_NAME
	as a prefix.
	(num_bytes): Delete
	(objcoopy_internal_note): Add padded_namesz field.
	(DEBUG_MERGE): New macro.  Set to non-zero to enable debugging of
	the note merging code.
	(gap_exists): Rename to overlaps_or_adjoins and return TRUE for
	overlapping notes or adjoining notes.
	(contained_by, is_deleted_note, is_version_note)
	(compare_gnu_build_notes, sort_gnu_build_notes): New functions.
	(merge_gnu_build_notes):  Rework.  Sort notes into a mergeable
	order first.  Merge them.  Then sort them into an ascending
	address order before writing them out.
	(copy_object): Handle more than one mergeable note section.
	* testsuite/binutils-all/note-2-32.d: Update for new merging
	behaviour.
	* testsuite/binutils-all/note-2-32.s: Likewise.
	* testsuite/binutils-all/note-2-64.d: Likewise.
	* testsuite/binutils-all/note-2-64.s: Likewise.
	* testsuite/binutils-all/note-3-32.d: Likewise.
	* testsuite/binutils-all/note-3-32.s: Likewise.
	* testsuite/binutils-all/note-3-64.d: Likewise.
	* testsuite/binutils-all/note-3-64.s: Likewise.
	* testsuite/binutils-all/note-4-32.d: Likewise.
	* testsuite/binutils-all/note-4-32.s: Likewise.
	* testsuite/binutils-all/note-4-64.d: Likewise.
	* testsuite/binutils-all/note-4-64.s: Likewise.
	* testsuite/binutils-all/note-6-32.s: New test source file.
	* testsuite/binutils-all/note-6-64.s: New test source file.
	* testsuite/binutils-all/note-6-32.d: New test driver file.
	* testsuite/binutils-all/note-6-64.d: New test driver file.
	* testsuite/binutils-all/objcopy.exp: Run the new test.
parent 27cee81d
2019-10-25 Nick Clifton <nickc@redhat.com>
* objcopy.c (struct merged_note_section): New structure. Used to
chain together details of mergeable note sections.
(is_merged_note_section): Rename to is_megreable_note_section and
return true for note sections that use GNU_BUILD_ATTRS_SECTION_NAME
as a prefix.
(num_bytes): Delete
(objcoopy_internal_note): Add padded_namesz field.
(DEBUG_MERGE): New macro. Set to non-zero to enable debugging of
the note merging code.
(gap_exists): Rename to overlaps_or_adjoins and return TRUE for
overlapping notes or adjoining notes.
(contained_by, is_deleted_note, is_version_note)
(compare_gnu_build_notes, sort_gnu_build_notes): New functions.
(merge_gnu_build_notes): Rework. Sort notes into a mergeable
order first. Merge them. Then sort them into an ascending
address order before writing them out.
(copy_object): Handle more than one mergeable note section.
* testsuite/binutils-all/note-2-32.d: Update for new merging
behaviour.
* testsuite/binutils-all/note-2-32.s: Likewise.
* testsuite/binutils-all/note-2-64.d: Likewise.
* testsuite/binutils-all/note-2-64.s: Likewise.
* testsuite/binutils-all/note-3-32.d: Likewise.
* testsuite/binutils-all/note-3-32.s: Likewise.
* testsuite/binutils-all/note-3-64.d: Likewise.
* testsuite/binutils-all/note-3-64.s: Likewise.
* testsuite/binutils-all/note-4-32.d: Likewise.
* testsuite/binutils-all/note-4-32.s: Likewise.
* testsuite/binutils-all/note-4-64.d: Likewise.
* testsuite/binutils-all/note-4-64.s: Likewise.
* testsuite/binutils-all/note-6-32.s: New test source file.
* testsuite/binutils-all/note-6-64.s: New test source file.
* testsuite/binutils-all/note-6-32.d: New test driver file.
* testsuite/binutils-all/note-6-64.d: New test driver file.
* testsuite/binutils-all/objcopy.exp: Run the new test.
2019-10-25 Alan Modra <amodra@gmail.com>
* readelf.c (process_program_headers): Check PT_PHDR p_offset
......
This diff is collapsed.
......@@ -6,12 +6,11 @@
#...
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+\$<version>1[ ]+0x00000004[ ]+OPEN[ ]+Applies to region from 0x100 \(note1.s\)
[ ]+\$<tool>gcc 7.0.1[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\+<stack prot>true[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\*<PIC>static[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\*<ABI>0x0[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\$<version>1[ ]+0x00000004[ ]+OPEN[ ]+Applies to region from 0x104 \(note2.s\)
[ ]+!<stack prot>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x104
[ ]+\*<PIC>pic[ ]+0x00000004[ ]+func[ ]+Applies to region from 0x104 \(func1\)
[ ]+GA\$<version>3p1[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x100 to 0x10b \(note1.s\)
[ ]+GA\$<tool>gcc 7.0.1[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x10b
[ ]+GA\*<ABI>0x0[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x100 to 0x108 \(note1.s\)
[ ]+GA\+<stack prot>true[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x100 to 0x104 \(note1.s\)
[ ]+GA\*<PIC>static[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x104
[ ]+GA!<stack prot>false[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x104 to 0x108 \(note2.s\)
[ ]+GA\*<PIC>pic[ ]+0x00000008[ ]+func[ ]+Applies to region from 0x104 to 0x106 \(func1\)
#...
......@@ -6,32 +6,37 @@ note1.s:
.pushsection .gnu.build.attributes, "0x100000", %note
.balign 4
.dc.l 4
.dc.l 4
.dc.l 8
.dc.l 8
.dc.l 0x100
.asciz "$1"
.asciz "GA$3p1"
.dc.l 0x100
.dc.l 0x104
.dc.l 12
.dc.l 14
.dc.l 0
.dc.l 0x100
.asciz "$gcc 7.0.1"
.asciz "GA$gcc 7.0.1"
.dc.b 0,0
.dc.l 3
.dc.l 5
.dc.l 0
.dc.l 0x100
.dc.b 0x2b, 0x2, 0
.dc.b 0
.dc.b 0x47, 0x41, 0x2b, 0x2, 0
.dc.b 0,0,0
.dc.l 4
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2a, 0x7, 0, 0
.dc.b 0x47, 0x41, 0x2a, 0x7, 0, 0
.dc.b 0,0
.dc.l 4
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2a, 0x6, 0, 0
.dc.b 0x47, 0x41, 0x2a, 0x6, 0, 0
.dc.b 0,0
.popsection
......@@ -42,33 +47,38 @@ func1:
.dc.l 0x100
.pushsection .gnu.build.attributes, "0x100000", %note
.dc.l 4
.dc.l 4
.dc.l 8
.dc.l 8
.dc.l 0x100
.asciz "$1"
.asciz "GA$3p1"
.dc.l 0x104
.dc.l 12
.dc.l 0x108
.dc.l 14
.dc.l 0
.dc.l 0x100
.asciz "$gcc 7.0.1"
.asciz "GA$gcc 7.0.1"
.dc.b 0,0
.dc.l 3
.dc.l 5
.dc.l 0
.dc.l 0x100
.dc.b 0x21, 0x2, 0
.dc.b 0
.dc.b 0x47, 0x41, 0x21, 0x2, 0
.dc.b 0,0,0
.dc.l 4
.dc.l 4
.dc.l 6
.dc.l 8
.dc.l 0x101
.dc.b 0x2a, 0x7, 1, 0
.dc.l 0x104
.dc.b 0x47, 0x41, 0x2a, 0x7, 1, 0
.dc.b 0,0
.dc.l 0x104
.dc.l 0x106
.dc.l 4
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2a, 0x6, 0, 0
.dc.b 0x47, 0x41, 0x2a, 0x6, 0, 0
.dc.b 0,0
.popsection
......@@ -77,16 +87,18 @@ note3.s:
.dc.l 0x100
.pushsection .gnu.build.attributes, "0x100000", %note
.dc.l 4
.dc.l 4
.dc.l 8
.dc.l 8
.dc.l 0x100
.asciz "$1"
.asciz "GA$3p1"
.dc.l 0x108
.dc.l 0x10b
.dc.l 12
.dc.l 14
.dc.l 0
.dc.l 0x100
.asciz "$gcc 7.0.1"
.asciz "GA$gcc 7.0.1"
.dc.b 0,0
.popsection
......
......@@ -10,12 +10,11 @@
#...
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+\$<version>1[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x100 \(note1.s\)
[ ]+\$<tool>gcc 7.0.1[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\+<stack prot>true[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\*<PIC>static[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\*<ABI>0x0[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100
[ ]+\$<version>1[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x104 \(note2.s\)
[ ]+!<stack prot>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x104
[ ]+\*<PIC>pic[ ]+0x00000008[ ]+func[ ]+Applies to region from 0x104 \(func1\)
[ ]+GA\$<version>3p1[ ]+0x00000010[ ]+OPEN[ ]+Applies to region from 0x100 to 0x10b \(note1.s\)
[ ]+GA\$<tool>gcc 7.0.1[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x10b
[ ]+GA\*<ABI>0x0[ ]+0x00000010[ ]+OPEN[ ]+Applies to region from 0x100 to 0x108 \(note1.s\)
[ ]+GA\+<stack prot>true[ ]+0x00000010[ ]+OPEN[ ]+Applies to region from 0x100 to 0x104 \(note1.s\)
[ ]+GA\*<PIC>static[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x104
[ ]+GA!<stack prot>false[ ]+0x00000010[ ]+OPEN[ ]+Applies to region from 0x104 to 0x108 \(note2.s\)
[ ]+GA\*<PIC>pic[ ]+0x00000010[ ]+func[ ]+Applies to region from 0x104 to 0x106 \(func1\)
#...
......@@ -6,32 +6,43 @@ note1.s:
.pushsection .gnu.build.attributes, "0x100000", %note
.balign 4
.dc.l 4
.dc.l 8
.dc.l 16
.dc.l 0x100
.asciz "$1"
.asciz "GA$3p1"
.8byte 0x100
.8byte 0x104
.dc.l 12
.dc.l 14
.dc.l 0
.dc.l 0x100
.asciz "$gcc 7.0.1"
.asciz "GA$gcc 7.0.1"
.dc.b 0,0
.dc.l 5
.dc.l 0
.dc.l 0x100
.dc.b 0x47, 0x41, 0x2b, 0x2, 0
.dc.b 0,0,0
.dc.l 3
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2b, 0x2, 0
.dc.b 0
.dc.b 0x47, 0x41, 0x2a, 0x7, 0, 0
.dc.b 0,0
.dc.l 4
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2a, 0x7, 0, 0
.dc.b 0x47, 0x41, 0x2a, 0x6, 0, 0
.dc.b 0,0
.dc.l 4
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2a, 0x6, 0, 0
.dc.b 0x47, 0x41, 0x2a, 0x7, 0, 0
.dc.b 0,0
.popsection
......@@ -43,33 +54,38 @@ func1:
.dc.l 0x100
.pushsection .gnu.build.attributes, "0x100000", %note
.dc.l 4
.dc.l 8
.dc.l 8
.dc.l 16
.dc.l 0x100
.asciz "$1"
.asciz "GA$3p1"
.8byte 0x104
.8byte 0x108
.dc.l 12
.dc.l 14
.dc.l 0
.dc.l 0x100
.asciz "$gcc 7.0.1"
.dc.l 3
.asciz "GA$gcc 7.0.1"
.dc.b 0,0
.dc.l 5
.dc.l 0
.dc.l 0x100
.dc.b 0x21, 0x2, 0
.dc.b 0
.dc.b 0x47, 0x41, 0x21, 0x2, 0
.dc.b 0,0,7
.dc.l 4
.dc.l 8
.dc.l 6
.dc.l 16
.dc.l 0x101
.dc.b 0x2a, 0x7, 1, 0
.dc.b 0x47, 0x41, 0x2a, 0x7, 1, 0
.dc.b 0,0
.8byte 0x104
.8byte 0x106
.dc.l 4
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x2a, 0x6, 0, 0
.dc.b 0x47, 0x41, 0x2a, 0x6, 0, 0
.dc.b 0,0
.popsection
......@@ -78,15 +94,17 @@ note3.s:
.dc.l 0x100
.pushsection .gnu.build.attributes, "0x100000", %note
.dc.l 4
.dc.l 8
.dc.l 8
.dc.l 16
.dc.l 0x100
.asciz "$1"
.asciz "GA$3p1"
.8byte 0x108
.8byte 0x10b
.dc.l 12
.dc.l 14
.dc.l 0
.dc.l 0x100
.asciz "$gcc 7.0.1"
.asciz "GA$gcc 7.0.1"
.dc.b 0,0
.popsection
......@@ -7,12 +7,12 @@
#...
Displaying notes found in: .gnu.build.attributes
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+GA\$<version>2p1[ ]+0x0000000.[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122 \(note_1.s\)
[ ]+GA\$<tool>gcc 6.3.1 20161221[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\$<version>3p1[ ]+0x0000000.[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122 \(note_1.s\)
[ ]+GA\*<stack prot>off[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\$<tool>gcc 6.3.1 20161221[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*<PIC>PIC[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\!<short enum>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
#...
......@@ -9,10 +9,11 @@ note_1.s:
.balign 4
.dc.l 8
.dc.l 4
.dc.l 8
.dc.l 0x100
.asciz "GA$2p1"
.dc.l note_1.s
.asciz "GA$3p1"
.dc.l 0x100 /* note_1.s */
.dc.l 0x122 /* note_1.s end */
.dc.l 23
.dc.l 0
......@@ -55,4 +56,12 @@ note_1.s:
.dc.l 0x100
.dc.b 0x47, 0x41, 0x2a, 0x6, 0xf2, 0x3, 0x38, 0xee, 0xce, 0xfa, 0x5e, 0x3c, 0
.dc.b 0, 0, 0
.dc.l 5
.dc.l 0
.dc.l 0x100
.dc.b 0x47, 0x41, 0x21, 0x8, 0
.dc.b 0, 0, 0
.popsection
......@@ -7,12 +7,12 @@
#...
Displaying notes found in: .gnu.build.attributes
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+GA\$<version>2p1[ ]+0x0000000.[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122 \(note_1.s\)
[ ]+GA\$<tool>gcc 6.3.1 20161221[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\$<version>3p1[ ]+0x00000010[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122 \(note_1.s\)
[ ]+GA\*<stack prot>off[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\$<tool>gcc 6.3.1 20161221[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*<PIC>PIC[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\!<short enum>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x122
#...
......@@ -9,10 +9,11 @@ note_1.s:
.balign 4
.dc.l 8
.dc.l 8
.dc.l 16
.dc.l 0x100
.asciz "GA$2p1"
.8byte note_1.s
.asciz "GA$3p1"
.8byte 0x100 /* note_1.s */
.8byte 0x122 /* note_1 end */
.dc.l 23
.dc.l 0
......@@ -55,4 +56,11 @@ note_1.s:
.dc.l 0x100
.dc.b 0x47, 0x41, 0x2a, 0x6, 0xf2, 0x3, 0x38, 0xee, 0xce, 0xfa, 0x5e, 0x3c, 0
.dc.b 0, 0, 0
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x47, 0x41, 0x2a, 0x7, 0x2, 0
.dc.b 0, 0
.popsection
......@@ -8,12 +8,12 @@
Displaying notes found in: .gnu.build.attributes
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+GA\$<version>3p3[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110 \(note_4.s\)
[ ]+GA\$<tool>gcc 7.2.1 20170915[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*<stack prot>off[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\$<tool>gcc 7.2.1 20170915[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*<PIC>PIC[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\!<short enum>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x10. to 0x110
[ ]+GA\*<stack prot>strong[ ]+0x00000008[ ]+func[ ]+Applies to region from 0x10. to 0x10c.*
#...
......@@ -18,8 +18,8 @@ note_4.s_end:
.dc.l 8
.dc.l 0x100
.asciz "GA$3p3"
.dc.l note_4.s - 2
.dc.l note_4.s_end
.dc.l 0x100 /* note_4.s - 2 */
.dc.l 0x110 /* note_4.s_end */
.dc.l 23
.dc.l 0
......@@ -63,12 +63,18 @@ note_4.s_end:
.dc.b 0x47, 0x41, 0x2a, 0x6, 0xf2, 0x3, 0x38, 0xee, 0xce, 0xfa, 0x5e, 0x3c, 0
.dc.b 0, 0, 0
.dc.l 5
.dc.l 0
.dc.l 0x100
.dc.b 0x47, 0x41, 0x21, 0x8, 0
.dc.b 0, 0, 0
.dc.l 6
.dc.l 8
.dc.l 0x101
.dc.b 0x47, 0x41, 0x2a, 0x2, 0x3, 0
.dc.b 0, 0
.dc.l bar
.dc.l bar_end
.dc.l 0x108 /* bar */
.dc.l 0x10c /* bar_end */
.popsection
......@@ -8,12 +8,12 @@
Displaying notes found in: .gnu.build.attributes
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+GA\$<version>3p3[ ]+0x00000010[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120 \(note_4.s\)
[ ]+GA\$<tool>gcc 7.2.1 20170915[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*<stack prot>off[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\$<tool>gcc 7.2.1 20170915[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*<PIC>PIC[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\!<short enum>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*<stack prot>strong[ ]+0x00000010[ ]+func[ ]+Applies to region from 0x110 to 0x11c.*
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x120
[ ]+GA\*<stack prot>strong[ ]+0x00000010[ ]+func[ ]+Applies to region from 0x110 to 0x120.*
#...
......@@ -22,8 +22,8 @@ note_4.s_end:
.dc.l 16
.dc.l 0x100
.asciz "GA$3p3"
.8byte note_4.s - 2
.8byte note_4.s_end
.8byte 0x100 /* note_4.s - 2 */
.8byte 0x120 /* note_4.s_end */
.dc.l 23
.dc.l 0
......@@ -67,12 +67,18 @@ note_4.s_end:
.dc.b 0x47, 0x41, 0x2a, 0x6, 0xf2, 0x3, 0x38, 0xee, 0xce, 0xfa, 0x5e, 0x3c, 0
.dc.b 0, 0, 0
.dc.l 6
.dc.l 0
.dc.l 0x100
.dc.b 0x47, 0x41, 0x2a, 0x7, 0x2, 0
.dc.b 0, 0
.dc.l 6
.dc.l 16
.dc.l 0x101
.dc.b 0x47, 0x41, 0x2a, 0x2, 0x3, 0
.dc.b 0, 0
.8byte bar
.8byte bar_end
.8byte 0x110 /* bar */
.8byte 0x120 /* bar_end */
.popsection
#PROG: objcopy
#readelf: --notes --wide
#objcopy: --merge-notes
#name: v3 gnu build attribute note merging (32-bit)
#source: note-6-32.s
#...
Displaying notes found in: .gnu.build.attributes
[ ]+Owner[ ]+Data size[ ]+Description
[ ]+GA\$<version>3p1[ ]+0x00000008[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106 \(note_test\)
[ ]+GA\*<stack prot>off[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\$<tool>gcc 8.3.1 20190507[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\*<ABI>0x[0-9a-f]+[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\*<PIC>PIC[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\!<short enum>false[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\*FORTIFY:0xff[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\*GOW:0x700[ ]+0x00000000[ ]+OPEN[ ]+Applies to region from 0x100 to 0x106
[ ]+GA\$<version>3p1[ ]+0x00000008[ ]+func[ ]+Applies to region from 0x102 to 0x106
[ ]+GA\$<tool>hello world[ ]+0x00000000[ ]+func[ ]+Applies to region from 0x102 to 0x106
#...
.text
.org 0x100
.global note_test
note_test:
note_1_start:
.word 0
note_1_end:
note_2_start:
.word 0
note_2_end:
note_3_start:
.word 0