aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all/note-4-64.s
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2018-01-03 10:28:33 +0000
committerNick Clifton <nickc@redhat.com>2018-01-03 10:30:07 +0000
commit6f156d7a4ad1c245b357dc50f63f3564d397839e (patch)
treea247aad883eb6ba6eeb0c9715c218527fc25c869 /binutils/testsuite/binutils-all/note-4-64.s
parent9f757bf7fcb8834ead780e0c4a76d6029b1402c2 (diff)
downloadbinutils-6f156d7a4ad1c245b357dc50f63f3564d397839e.zip
binutils-6f156d7a4ad1c245b357dc50f63f3564d397839e.tar.gz
binutils-6f156d7a4ad1c245b357dc50f63f3564d397839e.tar.bz2
Add support for v3 binary annotation notes.
I am checking in the attached patch which updates the binutils support for version 3 binary annotation notes. (Version 3 adds an end address to the ranges covered by the notes, so that it is possible to detect gaps in the coverage). This patch also stops the note merging feature of objcopy from executing if the notes have relocations against them. This makes the code simpler, and prevents the problems with architectures which have unusual relocation management issues. * objcopy.c (objcopy_internal_note): New structure. (gap_exists): New function. (is_open_note): New function. (is_func_note): New function. (is_64bit): New function. (merge_gnu_build_notes): Handle v3 notes. Do not merge if there are relocations against the notes. * readelf.c (get_note_type): Use short names for build attribute notes. (print_symbol_for_build_attribute): Rename to get_symbol_for_build_attribute. Returns the found symbol rather than printing it. (print_gnu_build_attribute_description): Maintain address ranges for function notes as well as global notes. Handle v3 notes. (print_gnu_build_attribute_name): Use more space for printing the name in wide mode. * testsuite/binutils-all/note-2-32.s: Use .dc.l instead of .word. Eliminate symbol references in order to remove the need for relocations. * testsuite/binutils-all/note-2-64.s: Likewise. * testsuite/binutils-all/note-3-32.s: Add a size to the note_1 symbol. * testsuite/binutils-all/note-3-64.s: Likewise. * testsuite/binutils-all/mips/mips-note-2r-n32.d: Update expected output. * testsuite/binutils-all/mips/mips-note-2r-n64.d: Likewise. * testsuite/binutils-all/mips/mips-note-2r.d: Likewise. * testsuite/binutils-all/note-2-32.d: Likewise. * testsuite/binutils-all/note-2-64.d: Likewise. * testsuite/binutils-all/note-3-32.d: Likewise. * testsuite/binutils-all/note-3-64.d: Likewise. * testsuite/binutils-all/note-4-64.s: New test. Checks v3 notes. * testsuite/binutils-all/note-4-32.s: New test. * testsuite/binutils-all/note-4-64.d: New test result file. * testsuite/binutils-all/note-4-32.d: New test result file.
Diffstat (limited to 'binutils/testsuite/binutils-all/note-4-64.s')
-rw-r--r--binutils/testsuite/binutils-all/note-4-64.s78
1 files changed, 78 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/note-4-64.s b/binutils/testsuite/binutils-all/note-4-64.s
new file mode 100644
index 0000000..4f53298
--- /dev/null
+++ b/binutils/testsuite/binutils-all/note-4-64.s
@@ -0,0 +1,78 @@
+ .text
+ .org 0x100
+note_4.s:
+ .dc.l 0
+ .dc.l 0
+ .dc.l 0
+ .dc.l 0
+
+ .type bar, @function
+bar:
+ .dc.l 0
+ .dc.l 0
+ .dc.l 0
+bar_end:
+ .dc.l 0
+note_4.s_end:
+
+ .pushsection .gnu.build.attributes, "", %note
+ .balign 4
+
+ .dc.l 8
+ .dc.l 16
+ .dc.l 0x100
+ .asciz "GA$3p3"
+ .8byte note_4.s
+ .8byte note_4.s_end
+
+ .dc.l 23
+ .dc.l 0
+ .dc.l 0x100
+ .asciz "GA$gcc 7.2.1 20170915"
+ .dc.b 0
+
+ .dc.l 10
+ .dc.l 0
+ .dc.l 0x100
+ .dc.b 0x47, 0x41, 0x2a, 0x47, 0x4f, 0x57, 0, 0, 0x7, 0
+ .dc.b 0, 0
+
+ .dc.l 6
+ .dc.l 0
+ .dc.l 0x100
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0
+ .dc.b 0, 0
+
+ .dc.l 13
+ .dc.l 0
+ .dc.l 0x100
+ .dc.b 0x47, 0x41, 0x2a, 0x46, 0x4f, 0x52, 0x54, 0x49, 0x46, 0x59, 0, 0xff, 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 5
+ .dc.l 0
+ .dc.l 0x100
+ .dc.b 0x47, 0x41, 0x21, 0x8, 0
+ .dc.b 0, 0, 0
+
+ .dc.l 13
+ .dc.l 0
+ .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 16
+ .dc.l 0x101
+ .dc.b 0x47, 0x41, 0x2a, 0x2, 0x3, 0
+ .dc.b 0, 0
+ .8byte bar
+ .8byte bar_end
+
+ .popsection