From b84f59efc6d6d8e97135a1b92ca224d1b2cffe16 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 13 Jul 2018 15:48:49 +0100 Subject: [PATCH] Add a test that relocs are correctly generated for missing build notes. * testsuite/gas/elf/missing-build-notes.s: New test. Checks that relocs are correctly generated for missing build notes. * testsuite/gas/elf/missing-build-notes.d: New file. Expected output from objdump. * testsuite/gas/elf/elf.exp: Run the new test. --- gas/ChangeLog | 8 ++++++++ gas/testsuite/gas/elf/elf.exp | 2 ++ gas/testsuite/gas/elf/missing-build-notes.d | 14 ++++++++++++++ gas/testsuite/gas/elf/missing-build-notes.s | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 gas/testsuite/gas/elf/missing-build-notes.d create mode 100644 gas/testsuite/gas/elf/missing-build-notes.s diff --git a/gas/ChangeLog b/gas/ChangeLog index a0406ce3651..770c44c8d2a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2018-07-13 Nick Clifton + + * testsuite/gas/elf/missing-build-notes.s: New test. Checks that + relocs are correctly generated for missing build notes. + * testsuite/gas/elf/missing-build-notes.d: New file. Expected + output from objdump. + * testsuite/gas/elf/elf.exp: Run the new test. + 2018-07-13 Nick Clifton * config/tc-arm.c (do_neon_mov): When converting an integer diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp index bb10ac63bc0..a7c793b0b0c 100644 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -244,6 +244,8 @@ if { [is_elf_format] } then { run_dump_test "bad-group" run_dump_test "syms" + + run_dump_test "missing-build-notes" # hpux has a non-standard common directive. if { ![istarget "*-*-hpux*"] } then { diff --git a/gas/testsuite/gas/elf/missing-build-notes.d b/gas/testsuite/gas/elf/missing-build-notes.d new file mode 100644 index 00000000000..1d3efbbba05 --- /dev/null +++ b/gas/testsuite/gas/elf/missing-build-notes.d @@ -0,0 +1,14 @@ +# as: --generate-missing-build-notes=yes +# objdump: -r +#skip: mips*-*-openbsd + +# Check that the relocations are for increasing addresses... + +#... +RELOCATION RECORDS FOR \[.gnu.build.attributes\]: +OFFSET[ ]+TYPE[ ]+VALUE +0+014 .*[ ]+.* +0+0(18|1c) .*[ ]+.* +0+0(30|38) .*[ ]+.* +0+0(34|40) .*[ ]+.* +#pass diff --git a/gas/testsuite/gas/elf/missing-build-notes.s b/gas/testsuite/gas/elf/missing-build-notes.s new file mode 100644 index 00000000000..72797cdcd83 --- /dev/null +++ b/gas/testsuite/gas/elf/missing-build-notes.s @@ -0,0 +1,6 @@ + .text + .dc.l 1 + + .section .text.unused,"ax" + .dc.l 2 + -- 2.30.2