aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-12-03 14:51:00 +0000
committerNick Clifton <nickc@redhat.com>2008-12-03 14:51:00 +0000
commite7c3341679431c5ecfc170a984d7196cdc175777 (patch)
tree5be48e5e73b1b747806d4cc47c80ca9893f3aea4 /bfd/elf32-arm.c
parent5d73705c26e9cb0108f95c127fc5b87c9a982289 (diff)
downloadgdb-e7c3341679431c5ecfc170a984d7196cdc175777.zip
gdb-e7c3341679431c5ecfc170a984d7196cdc175777.tar.gz
gdb-e7c3341679431c5ecfc170a984d7196cdc175777.tar.bz2
include/elf/
* common.h (STT_IFUNC): Define. elfcpp/ * elfcpp.h (enum STT): Add STT_IFUNC. bfd/ * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION. Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags to remove gaps. (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION. (bfd_decode_symclass): Likewise. * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into STT_IFUNC. (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC. (_bfd_elf_is_function_type): Likewise. * elf32-arm.c (arm_elf_find_function): Likewise. (elf32_arm_adjust_dynamic_symbol): Likewise. (elf32_arm_swap_symbol_in): Likewise. (elf32_arm_additional_program_headers): Likewise. * elf32-i386.c (is_indirect_symbol): New function. (elf_i386_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (is_indirect_symbol): New function. (elf64_x86_64_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into BSF_INDIRECT_FUNCTION. * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support for STT_IFUNC symbols. (get_ifunc_reloc_section_name): New function. (_bfd_elf_make_ifunc_reloc_section): New function. * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field. * bfd-in2.h: Regenerate. gas/ * config/obj-elf.c (obj_elf_type): Add support for STT_IFUNC type. * doc/as.texinfo: Document new feature. * NEWS: Mention new feature. gas/testsuite/ * gas/elf/type.s: Add test of STT_IFUNC symbol type. * gas/elf/type.e: Update expected disassembly. * gas/elf/elf.exp: Update grep of symbol types. ld/ * NEWS: Mention new feature. * pe-dll.c (process_def_file): Replace use of redundant BFD_FORT_COMM_DEFAULT_VALUE with 0. * scripttempl/elf.sc: Add .rel.ifunc.dyn and .rela.ifunc.dyn sections. ld/testsuite/ * ld-mips-elf/reloc-1-n32.d: Updated expected output for reloc descriptions. * ld-mips-elf/reloc-1-n64.d: Likewise. * ld-i386/ifunc.d: New test. * ld-i386/ifunc.s: Source file for the new test. * ld-i386/i386.exp: Run the new test.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index cd5a9bf..dacbc16 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9430,6 +9430,7 @@ arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED,
filename = bfd_asymbol_name (&q->symbol);
break;
case STT_FUNC:
+ case STT_IFUNC:
case STT_ARM_TFUNC:
case STT_NOTYPE:
/* Skip mapping symbols. */
@@ -9555,7 +9556,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
/* If this is a function, put it in the procedure linkage table. We
will fill in the contents of the procedure linkage table later,
when we know the address of the .got section. */
- if (h->type == STT_FUNC || h->type == STT_ARM_TFUNC
+ if (h->type == STT_FUNC || h->type == STT_ARM_TFUNC || h->type == STT_IFUNC
|| h->needs_plt)
{
if (h->plt.refcount <= 0
@@ -11729,7 +11730,8 @@ elf32_arm_swap_symbol_in (bfd * abfd,
/* New EABI objects mark thumb function symbols by setting the low bit of
the address. Turn these into STT_ARM_TFUNC. */
- if (ELF_ST_TYPE (dst->st_info) == STT_FUNC
+ if ((ELF_ST_TYPE (dst->st_info) == STT_FUNC
+ || ELF_ST_TYPE (dst->st_info) == STT_IFUNC)
&& (dst->st_value & 1))
{
dst->st_info = ELF_ST_INFO (ELF_ST_BIND (dst->st_info), STT_ARM_TFUNC);
@@ -11830,7 +11832,7 @@ elf32_arm_additional_program_headers (bfd *abfd,
static bfd_boolean
elf32_arm_is_function_type (unsigned int type)
{
- return (type == STT_FUNC) || (type == STT_ARM_TFUNC);
+ return (type == STT_FUNC) || (type == STT_ARM_TFUNC) || (type == STT_IFUNC);
}
/* We use this to override swap_symbol_in and swap_symbol_out. */