diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-09-06 13:34:30 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-09-06 13:34:44 -0700 |
commit | d8457a04b71cbd642a00352dce0539fe1fe22dd4 (patch) | |
tree | 8186684ed03e5f53ef3cb15df1698b8ee8d37bdc /ld | |
parent | 22d6c51be8de9a091d89c0e11e6e140f333ade62 (diff) | |
download | fsf-binutils-gdb-d8457a04b71cbd642a00352dce0539fe1fe22dd4.zip fsf-binutils-gdb-d8457a04b71cbd642a00352dce0539fe1fe22dd4.tar.gz fsf-binutils-gdb-d8457a04b71cbd642a00352dce0539fe1fe22dd4.tar.bz2 |
Resolve size relocation with copy relocation
We can resolve size relocation against symbol which needs copy relocation
when building executable.
bfd/
PR ld/20550
* elf64-x86-64.c (elf_x86_64_relocate_section): Resolve size
relocation with copy relocation when building executable.
ld/
PR ld/20550
* testsuite/ld-x86-64/pr20550a.s: New file.
* testsuite/ld-x86-64/pr20550b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp (x86_64tests): Add tests for
PR ld/20550.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr20550a.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr20550b.s | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/x86-64.exp | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 85d7820..7d3e292 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2016-09-06 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/20550 + * testsuite/ld-x86-64/pr20550a.s: New file. + * testsuite/ld-x86-64/pr20550b.s: Likewise. + * testsuite/ld-x86-64/x86-64.exp (x86_64tests): Add tests for + PR ld/20550. + 2016-09-06 Nick Clifton <nickc@redhat.com> * Makefile.am (CFLAGS_FOR_TARGET): Define as a copy of CFLAGS but diff --git a/ld/testsuite/ld-x86-64/pr20550a.s b/ld/testsuite/ld-x86-64/pr20550a.s new file mode 100644 index 0000000..4430398 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr20550a.s @@ -0,0 +1,6 @@ + .text + .global _start +_start: + movabsq $strings@SIZE, %rdx + .section .data.rel,"aw",@progbits + .quad strings diff --git a/ld/testsuite/ld-x86-64/pr20550b.s b/ld/testsuite/ld-x86-64/pr20550b.s new file mode 100644 index 0000000..fbc482a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr20550b.s @@ -0,0 +1,10 @@ + .globl strings + .section .rodata +.LC0: + .string "test" + .section .data.rel.local,"aw",@progbits + .align 8 + .type strings, @object + .size strings, 8 +strings: + .quad .LC0 diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index c24eeea..c84bdf1 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -207,6 +207,12 @@ set x86_64tests { "--64" { pr19827a.S } {{readelf {-rW} pr19827.rd}} "pr19827.so"} {"Build pr19969.so" "-melf_x86_64 -shared" "" "--64" { pr19969a.S } {} "pr19969.so"} + {"Build pr20550a.o" "" "" + "--64" { pr20550a.s }} + {"Build pr20550b.so" "-melf_x86_64 -shared" "" + "--64" { pr20550b.s } {} "pr20550b.so"} + {"Build pr20550" "-melf_x86_64 -pie tmpdir/pr20550a.o tmpdir/pr20550b.so" "" + "--64" { dummy.s } {} "pr20550"} } # So as to avoid rewriting every last test case here in a nacl variant, |