diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2019-01-29 06:07:42 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2019-01-29 06:07:42 -0800 |
commit | ad0f979c9df2cc3fba1f120c5e7f39e35591ed07 (patch) | |
tree | 829f486006ea0a42d290335df16fc772a37a6d46 /ld | |
parent | c49829c3c331182575034911f2bb053dfbb7d8a8 (diff) | |
download | binutils-ad0f979c9df2cc3fba1f120c5e7f39e35591ed07.zip binutils-ad0f979c9df2cc3fba1f120c5e7f39e35591ed07.tar.gz binutils-ad0f979c9df2cc3fba1f120c5e7f39e35591ed07.tar.bz2 |
Add a testcase for PR ld/24008
PR ld/24008
* testsuite/ld-scripts/defined.exp: Run pr24008.
* testsuite/ld-scripts/pr24008.d: New file.
* testsuite/ld-scripts/pr24008.map: Likewise.
* testsuite/ld-scripts/pr24008.s: Likewise.
* testsuite/ld-scripts/pr24008.t: Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/defined.exp | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/pr24008.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/pr24008.map | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/pr24008.s | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/pr24008.t | 8 |
6 files changed, 35 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 2e3e7df..dc99b16 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2019-01-29 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/24008 + * testsuite/ld-scripts/defined.exp: Run pr24008. + * testsuite/ld-scripts/pr24008.d: New file. + * testsuite/ld-scripts/pr24008.map: Likewise. + * testsuite/ld-scripts/pr24008.s: Likewise. + * testsuite/ld-scripts/pr24008.t: Likewise. + 2019-01-29 Eric Botcazou <ebotcazou@adacore.com> * testsuite/ld-ifunc/ifunc.exp: Skip pr23169 on SPARC. diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp index 21590e2..d98e307 100644 --- a/ld/testsuite/ld-scripts/defined.exp +++ b/ld/testsuite/ld-scripts/defined.exp @@ -79,5 +79,6 @@ if ![is_aout_format] { if [is_elf_format] { run_dump_test "defined6" } +run_dump_test "pr24008" set LDFLAGS "$saved_LDFLAGS" set ASFLAGS "$saved_ASFLAGS" diff --git a/ld/testsuite/ld-scripts/pr24008.d b/ld/testsuite/ld-scripts/pr24008.d new file mode 100644 index 0000000..3938d4f --- /dev/null +++ b/ld/testsuite/ld-scripts/pr24008.d @@ -0,0 +1,8 @@ +#ld: -T pr24008.t -Map tmpdir/pr24008.map +#nm: -B +#map: pr24008.map + +#... +0+42 A defined +0+42 A sym1 +0+43 A sym2 diff --git a/ld/testsuite/ld-scripts/pr24008.map b/ld/testsuite/ld-scripts/pr24008.map new file mode 100644 index 0000000..c331940 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr24008.map @@ -0,0 +1,7 @@ +#... +Linker script and memory map +#... + 0x0+42 +sym1 = 0x42 + 0x0+43 +sym2 = 0x43 + 0x0+42 +defined = DEFINED \(sym1\)\?sym1:sym2 +#... diff --git a/ld/testsuite/ld-scripts/pr24008.s b/ld/testsuite/ld-scripts/pr24008.s new file mode 100644 index 0000000..328ba74 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr24008.s @@ -0,0 +1,2 @@ + .text + .byte 0 diff --git a/ld/testsuite/ld-scripts/pr24008.t b/ld/testsuite/ld-scripts/pr24008.t new file mode 100644 index 0000000..902088e --- /dev/null +++ b/ld/testsuite/ld-scripts/pr24008.t @@ -0,0 +1,8 @@ +SECTIONS { + .text : { *(.text) } + .data : { *(.data) } + .bss : { *(.bss) *(COMMON) } +} +sym1 = 0x42; +sym2 = 0x43; +defined = DEFINED (sym1) ? sym1 : sym2; |