diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-11-18 07:54:34 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-11-18 07:58:52 -0800 |
commit | 7c80aab93666727965c2d5d6e17b1338d88293e0 (patch) | |
tree | afa7fa215c740c62255a2b2580804d466d8055b7 /ld | |
parent | a0cfd0ca0ea26f157957c42b359b750c6f53d4bf (diff) | |
download | gdb-7c80aab93666727965c2d5d6e17b1338d88293e0.zip gdb-7c80aab93666727965c2d5d6e17b1338d88293e0.tar.gz gdb-7c80aab93666727965c2d5d6e17b1338d88293e0.tar.bz2 |
elf/x86: Issue an error on discarded output .plt section
Issue an error, instead of crash, on discarded output .plt section.
bfd/
PR ld/28597
* elf32-i386.c (elf_i386_finish_dynamic_sections): Issue an error
on discarded output .plt section.
* elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
ld/
PR ld/28597
* testsuite/ld-elf/pr28597.d: New file.
* testsuite/ld-elf/pr28597.s: Likewise.
* testsuite/ld-elf/pr28597.t: Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ld-elf/pr28597.d | 3 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr28597.s | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr28597.t | 14 |
3 files changed, 21 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr28597.d b/ld/testsuite/ld-elf/pr28597.d new file mode 100644 index 0000000..886182c --- /dev/null +++ b/ld/testsuite/ld-elf/pr28597.d @@ -0,0 +1,3 @@ +#ld: -shared -T pr28597.t +#error: .*: discarded output section: `.plt' +#target: i?86-*-* x86_64-*-* diff --git a/ld/testsuite/ld-elf/pr28597.s b/ld/testsuite/ld-elf/pr28597.s new file mode 100644 index 0000000..620a635 --- /dev/null +++ b/ld/testsuite/ld-elf/pr28597.s @@ -0,0 +1,4 @@ + .text + .globl foo +foo: + jmp bar@PLT diff --git a/ld/testsuite/ld-elf/pr28597.t b/ld/testsuite/ld-elf/pr28597.t new file mode 100644 index 0000000..1f47a45 --- /dev/null +++ b/ld/testsuite/ld-elf/pr28597.t @@ -0,0 +1,14 @@ +SECTIONS +{ + .text : + { + *(.text .text.*) + } + /DISCARD/ : { *(.dynsym) } + /DISCARD/ : { *(.dynstr*) } + /DISCARD/ : { *(.dynamic*) } + /DISCARD/ : { *(.plt*) } + /DISCARD/ : { *(.interp*) } + /DISCARD/ : { *(.gnu*) } + /DISCARD/ : { *(.note.gnu.property) } +} |