diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-10-21 15:13:37 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-10-21 15:13:37 +0000 |
commit | e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8 (patch) | |
tree | 3d07b587ea6ee595937027d07e992bb434085d08 /ld | |
parent | f8e24652cb7bb02eb602d1c8a10ef068b8612cf9 (diff) | |
download | gdb-e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8.zip gdb-e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8.tar.gz gdb-e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8.tar.bz2 |
Put IRELATIVE relocations after JUMP_SLOT.
bfd/
2011-10-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13302
* elf32-i386.c (elf_i386_link_hash_table): Add next_jump_slot_index
and next_irelative_index.
(elf_i386_link_hash_table_create): Initialize next_jump_slot_index
and next_irelative_index.
(elf_i386_allocate_dynrelocs): Increment reloc_count instead of
next_tls_desc_index.
(elf_i386_size_dynamic_sections): Set next_tls_desc_index and
next_irelative_index from reloc_count.
(elf_i386_finish_dynamic_symbol): Put R_386_IRELATIVE after
R_386_JUMP_SLOT.
* elf64-x86-64.c (elf_x86_64_link_hash_table): Add
next_jump_slot_index and next_irelative_index.
(elf_x86_64_link_hash_table_create): Initialize
next_jump_slot_index and next_irelative_index.
(elf_x86_64_size_dynamic_sections): Set next_irelative_index
from reloc_count.
(elf_x86_64_finish_dynamic_symbol): Put R_X86_64_IRELATIVE after
R_X86_64_JUMP_SLOT.
ld/testsuite/
2011-10-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13302
* ld-ifunc/ifunc-16-i386.d: New.
* ld-ifunc/ifunc-16-x86-64.d: Likewise.
* ld-ifunc/ifunc-16-x86.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-ifunc/ifunc-16-i386.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-ifunc/ifunc-16-x86-64.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-ifunc/ifunc-16-x86.s | 17 |
4 files changed, 44 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index fc9caf9..8480fee 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-10-21 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/13302 + * ld-ifunc/ifunc-16-i386.d: New. + * ld-ifunc/ifunc-16-x86-64.d: Likewise. + * ld-ifunc/ifunc-16-x86.s: Likewise. + 2011-10-20 Alan Modra <amodra@gmail.com> * ld-selective/selective.exp: Use check_gc_sections_available. diff --git a/ld/testsuite/ld-ifunc/ifunc-16-i386.d b/ld/testsuite/ld-ifunc/ifunc-16-i386.d new file mode 100644 index 0000000..8ae3d0a --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-16-i386.d @@ -0,0 +1,10 @@ +#source: ifunc-16-x86.s +#ld: -shared -m elf_i386 +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +Relocation section '.rel.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_JUMP_SLOT[ ]+0+[ ]+ifunc +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* diff --git a/ld/testsuite/ld-ifunc/ifunc-16-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-16-x86-64.d new file mode 100644 index 0000000..d69626d --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-16-x86-64.d @@ -0,0 +1,10 @@ +#source: ifunc-16-x86.s +#as: --64 +#ld: -shared -melf_x86_64 +#readelf: -r --wide +#target: x86_64-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_JUMP_SLOT[ ]+0+[ ]+ifunc \+ 0 +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* diff --git a/ld/testsuite/ld-ifunc/ifunc-16-x86.s b/ld/testsuite/ld-ifunc/ifunc-16-x86.s new file mode 100644 index 0000000..fb38253 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-16-x86.s @@ -0,0 +1,17 @@ + .text + .globl fct + .type fct, @gnu_indirect_function + .set fct,resolve + .hidden int_fct + .globl int_fct + .set int_fct,fct + .p2align 4,,15 + .type resolve, @function +resolve: + call ifunc@PLT + .size resolve, .-resolve + .globl g + .type g, @function +g: + jmp int_fct@PLT + .size g, .-g |