aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2018-04-26 15:12:42 +0100
committerNick Clifton <nickc@redhat.com>2018-04-26 15:12:42 +0100
commit0df8ad28f0f727fab3a696d6c98b9a8a77ee1024 (patch)
tree1c4194b04e789a81a0a82af590a12105209fd05b /binutils/testsuite
parentaa684341294a9125c528041f81d17c488bed5552 (diff)
downloadgdb-0df8ad28f0f727fab3a696d6c98b9a8a77ee1024.zip
gdb-0df8ad28f0f727fab3a696d6c98b9a8a77ee1024.tar.gz
gdb-0df8ad28f0f727fab3a696d6c98b9a8a77ee1024.tar.bz2
Extend the assembler so that it can automatically generate GNU Build attribute notes if none are present in the input files.
gas * as.c (flag_generate_build_notes): New variable. (show_usage): Add entry for --generate-missing-build-notes. (parse_args): Parse --generate-missing-build-notes. * as.h: Export flag_generate_build_notes. * symbols.c (save_symbol_name): Ensure that the name parameter is not NULL. * write.c (create_obj_attrs_section): Reformat. (create_note_reloc): New function - creates a relocation for a field in a GNU Build attribute note. (maybe_generate_build_notes): New function - created GNU Build attribute notes if none are present in the output file. (write_object_file): Call maybe_generate_build_notes. * configure.ac (--enable-generate-build-notes): New option. * NEWS: Announce the new feature. * doc/as.textinfo: Document the new option. * config.in: Regenerate. * configure: Regenerate. binutils* readelf.c (is_32bit_abs_reloc): Support R_PARISC_DIR32 as a 32-bit absolute reloc for the HPPA target. * testsuite/binutils-all/note-5.d: New test. * testsuite/binutils-all/note-5.s: Source file for new test. * testsuite/binutils-all/objcopy.exp: Run new test.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/binutils-all/note-5.d11
-rw-r--r--binutils/testsuite/binutils-all/note-5.s14
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp1
3 files changed, 26 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/note-5.d b/binutils/testsuite/binutils-all/note-5.d
new file mode 100644
index 0000000..d3bef15
--- /dev/null
+++ b/binutils/testsuite/binutils-all/note-5.d
@@ -0,0 +1,11 @@
+#PROG: objcopy
+#as: --generate-missing-build-notes=yes
+#readelf: --notes --wide
+#name: assembler generated build notes
+#source: note-5.s
+
+#...
+Displaying notes found in: .gnu.build.attributes
+[ ]+Owner[ ]+Data size[ ]+Description
+[ ]+GA\$<version>3a1[ ]+0x000000(08|10)[ ]+OPEN[ ]+Applies to region from 0 to 0x.. \(note_5.s\)
+#...
diff --git a/binutils/testsuite/binutils-all/note-5.s b/binutils/testsuite/binutils-all/note-5.s
new file mode 100644
index 0000000..4375b25
--- /dev/null
+++ b/binutils/testsuite/binutils-all/note-5.s
@@ -0,0 +1,14 @@
+ .text
+ .global note_5.s
+note_5.s:
+ .dc.l 2
+ .dc.l 4
+ .dc.l 6
+ .dc.l 8
+ .dc.l 8
+ .dc.l 8
+ .dc.l 8
+ .dc.l 8
+ .dc.l 8
+ .dc.l 8
+ \ No newline at end of file
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 2a2e757..3381236 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1058,6 +1058,7 @@ if [is_elf_format] {
run_dump_test "note-3-32"
run_dump_test "note-4-32"
}
+ run_dump_test "note-5"
}
run_dump_test "copy-2"