diff options
author | Alan Modra <amodra@gmail.com> | 2014-01-15 21:50:55 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-01-15 22:23:16 +1030 |
commit | 4199e3b8669d0a36448687850374fdc2ad7240b6 (patch) | |
tree | a7c11cbb939cda37c5e69363093c3ad0866b7df9 /ld/testsuite | |
parent | bb4142cf49651ddcb0e00f6aaf451272c4c9977d (diff) | |
download | fsf-binutils-gdb-4199e3b8669d0a36448687850374fdc2ad7240b6.zip fsf-binutils-gdb-4199e3b8669d0a36448687850374fdc2ad7240b6.tar.gz fsf-binutils-gdb-4199e3b8669d0a36448687850374fdc2ad7240b6.tar.bz2 |
non-PIC references to __ehdr_start in pie and shared
Rather than hacking every backend to not discard dynamic relocations
against an undefined hidden __ehdr_start, make it appear to be defined
early. We want __ehdr_start hidden before size_dynamic_sections so
that it isn't put in .dynsym, but we do need the dynamic relocations
for a PIE or shared library with a non-PIC reference. Defining it
early is wrong if we don't actually define the symbol later to its
proper value. (In some cases we want to leave the symbol undefined,
for example, when the ELF header isn't loaded, and we don't have this
infomation available in before_allocation.)
ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Define
__ehdr_start before size_dynamic_sections and restore afterwards.
ld/testsuite/
* ld-elf/ehdr_start-shared.d: New.
* ld-elf/ehdr_start-userdef.d: xfail frv.
* ld-elf/ehdr_start-weak.d: Likewise.
* ld-elf/ehdr_start.d: Likewise.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/ehdr_start-shared.d | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/ehdr_start-userdef.d | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/ehdr_start-weak.d | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/ehdr_start.d | 1 |
5 files changed, 19 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index cd97fd5..8fbd375 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-01-15 Alan Modra <amodra@gmail.com> + + * ld-elf/ehdr_start-shared.d: New. + * ld-elf/ehdr_start-userdef.d: xfail frv. + * ld-elf/ehdr_start-weak.d: Likewise. + * ld-elf/ehdr_start.d: Likewise. + 2014-01-14 Vidya Praveen <vidyapraveen@arm.com> * lib/ld-lib.exp (default_ld_link): Remove support for ldflags. diff --git a/ld/testsuite/ld-elf/ehdr_start-shared.d b/ld/testsuite/ld-elf/ehdr_start-shared.d new file mode 100644 index 0000000..c17516a --- /dev/null +++ b/ld/testsuite/ld-elf/ehdr_start-shared.d @@ -0,0 +1,9 @@ +#source: ehdr_start.s +#ld: -e _start -shared +#nm: -n +#target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: cris*-*-* frv-*-* + +#... +[0-9a-f]*000 [Adrt] __ehdr_start +#pass diff --git a/ld/testsuite/ld-elf/ehdr_start-userdef.d b/ld/testsuite/ld-elf/ehdr_start-userdef.d index 2a88e98..b58ae3f 100644 --- a/ld/testsuite/ld-elf/ehdr_start-userdef.d +++ b/ld/testsuite/ld-elf/ehdr_start-userdef.d @@ -2,6 +2,7 @@ #ld: -e _start -T ehdr_start-userdef.t #readelf: -Ws #target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: frv-*-* #... Symbol table '\.symtab' contains [0-9]+ entries: diff --git a/ld/testsuite/ld-elf/ehdr_start-weak.d b/ld/testsuite/ld-elf/ehdr_start-weak.d index 8bd9035..24ae34c 100644 --- a/ld/testsuite/ld-elf/ehdr_start-weak.d +++ b/ld/testsuite/ld-elf/ehdr_start-weak.d @@ -2,6 +2,7 @@ #ld: -e _start -T ehdr_start-missing.t #nm: -n #target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: frv-*-* #... \s+[wU] __ehdr_start diff --git a/ld/testsuite/ld-elf/ehdr_start.d b/ld/testsuite/ld-elf/ehdr_start.d index 52e5b54..d538b66 100644 --- a/ld/testsuite/ld-elf/ehdr_start.d +++ b/ld/testsuite/ld-elf/ehdr_start.d @@ -2,6 +2,7 @@ #ld: -e _start #nm: -n #target: *-*-linux* *-*-gnu* *-*-nacl* +#xfail: frv-*-* #... [0-9a-f]*000 [Adrt] __ehdr_start |