diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-09-14 11:41:58 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-09-14 12:29:29 -0700 |
commit | 5e5e02aeca4a6edccbf11b5f900d95bba59b9932 (patch) | |
tree | 75d5fa026dbb595fa819238129eb9cdb9e46b868 /ld | |
parent | 26e53f3eace35cabeec4559d417df99a48f6477a (diff) | |
download | gdb-5e5e02aeca4a6edccbf11b5f900d95bba59b9932.zip gdb-5e5e02aeca4a6edccbf11b5f900d95bba59b9932.tar.gz gdb-5e5e02aeca4a6edccbf11b5f900d95bba59b9932.tar.bz2 |
x86: Cache section contents and relocations
bfd/
PR ld/22135
* elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
to indicate if conversion is performed.
(elf_i386_check_relocs): Cache section contents and relocations
if conversion is performed.
* elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
contents and relocations if conversion is performed.
ld/
PR ld/22135
* testsuite/ld-i386/i386.exp: Run pr22135.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr22135.d: New file.
* testsuite/ld-i386/pr22135.s: Likewise.
* testsuite/ld-x86-64/pr22135.d: Likewise.
* testsuite/ld-x86-64/pr22135.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/i386.exp | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/pr22135.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-i386/pr22135.s | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr22135.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr22135.s | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/x86-64.exp | 1 |
7 files changed, 58 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 1d052f7..857f4c9 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2017-09-14 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/22135 + * testsuite/ld-i386/i386.exp: Run pr22135. + * testsuite/ld-x86-64/x86-64.exp: Likewise. + * testsuite/ld-i386/pr22135.d: New file. + * testsuite/ld-i386/pr22135.s: Likewise. + * testsuite/ld-x86-64/pr22135.d: Likewise. + * testsuite/ld-x86-64/pr22135.s: Likewise. + 2017-09-09 Alan Modra <amodra@gmail.com> * ld.texinfo (--plt-align): Describe new behaviour of option. diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index f691c32..d79c4583 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -444,6 +444,7 @@ run_dump_test "pr22115-1a" run_dump_test "pr22115-1b" run_dump_test "pr22115-1c" run_dump_test "pr22115-1d" +run_dump_test "pr22135" if { !([istarget "i?86-*-linux*"] || [istarget "i?86-*-gnu*"] diff --git a/ld/testsuite/ld-i386/pr22135.d b/ld/testsuite/ld-i386/pr22135.d new file mode 100644 index 0000000..a5796ba --- /dev/null +++ b/ld/testsuite/ld-i386/pr22135.d @@ -0,0 +1,12 @@ +#as: --32 -mrelax-relocations=yes +#ld: -pie -melf_i386 --no-keep-memory +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +#... +[ ]*[a-f0-9]+: 8d 81 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%ecx\),%eax +#pass diff --git a/ld/testsuite/ld-i386/pr22135.s b/ld/testsuite/ld-i386/pr22135.s new file mode 100644 index 0000000..6afad88 --- /dev/null +++ b/ld/testsuite/ld-i386/pr22135.s @@ -0,0 +1,11 @@ + .text + .globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .globl _start + .type _start, @function +_start: + movl foo@GOT(%ecx), %eax + .size _start, .-_start diff --git a/ld/testsuite/ld-x86-64/pr22135.d b/ld/testsuite/ld-x86-64/pr22135.d new file mode 100644 index 0000000..2cd6861 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22135.d @@ -0,0 +1,12 @@ +#as: --64 +#ld: -pie -melf_x86_64 --no-keep-memory +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +#... +[ ]*[a-f0-9]+: 8d 05 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo> +#pass diff --git a/ld/testsuite/ld-x86-64/pr22135.s b/ld/testsuite/ld-x86-64/pr22135.s new file mode 100644 index 0000000..f4dff5c --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22135.s @@ -0,0 +1,11 @@ + .text + .globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .globl _start + .type _start, @function +_start: + movl foo@GOTPCREL(%rip), %eax + .size _start, .-_start diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index edf8896..676d44a 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -377,6 +377,7 @@ run_dump_test "pr22115-1c" run_dump_test "pr22115-1c-x32" run_dump_test "pr22115-1d" run_dump_test "pr22115-1d-x32" +run_dump_test "pr22135" if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return |