[PATCH, ARM] Fix ld-elfvsb protected test failure.
Will Newton
will.newton@linaro.org
Wed Mar 20 15:59:00 GMT 2013
More information about the Binutils mailing list
Wed Mar 20 15:59:00 GMT 2013
- Previous message (by thread): [PATCH, ARM] Fix ld-elfvsb hidden_weak test failure.
- Next message (by thread): [PATCH, ARM] Fix ld-elfvsb protected test failure.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This test currently fails on ARM. The test code segfaults in ldso due to an R_ARM_GLOB_DAT dynamic reloc with r_symndx of 0xffffff being emitted into a shared object. This patch avoids that situation and allows the test to pass. I still don't really understand why SYMBOL_REFERENCES_LOCAL doesn't deal with this and if this problem is present on any other architectures, so this patch may make incorrect assumptions. Tested on armv7l-unknown-linux-gnueabihf. bfd/ChangeLog: 2013-03-20 Will Newton <will.newton@linaro.org> * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a dynamic reloc for symbols with dynindx == -1. (allocate_dynrelocs_for_symbol): Avoid allocating space for a dynamic reloc for symbols with dynindx == -1. --- bfd/elf32-arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index aa60a3f..1db7d97 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -9139,7 +9139,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { Elf_Internal_Rela outrel; - if (!SYMBOL_REFERENCES_LOCAL (info, h)) + if (h->dynindx != -1 && !SYMBOL_REFERENCES_LOCAL (info, h)) { /* If the symbol doesn't resolve locally in a static object, we have an undefined reference. If the @@ -13260,7 +13260,7 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) if ((tls_type & GOT_TLS_GD) && indx != 0) elf32_arm_allocate_dynrelocs (info, htab->root.srelgot, 1); } - else if (!SYMBOL_REFERENCES_LOCAL (info, h)) + else if (indx != -1 && !SYMBOL_REFERENCES_LOCAL (info, h)) { if (htab->root.dynamic_sections_created) /* Reserve room for the GOT entry's R_ARM_GLOB_DAT relocation. */ -- 1.8.1.4
- Previous message (by thread): [PATCH, ARM] Fix ld-elfvsb hidden_weak test failure.
- Next message (by thread): [PATCH, ARM] Fix ld-elfvsb protected test failure.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list