diff options
author | Nick Clifton <nickc@redhat.com> | 2016-01-21 10:51:25 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-01-21 10:51:25 +0000 |
commit | aebf9be7089c1903581740851ae9ae67ffee2f4b (patch) | |
tree | 85d66645a7d0137aff56bbf481f679bf8a873383 /bfd | |
parent | 305e13e67faaf940ce6eb708847a655a0735a651 (diff) | |
download | gdb-aebf9be7089c1903581740851ae9ae67ffee2f4b.zip gdb-aebf9be7089c1903581740851ae9ae67ffee2f4b.tar.gz gdb-aebf9be7089c1903581740851ae9ae67ffee2f4b.tar.bz2 |
Fix unexpected failures in the linker testsuite for ARM VxWorks targets.
PR ld/19455
* elf32-arm.c (elf32_arm_create_dynamic_sections): Set the ELF
class of the linker stub bfd.
(elf32_arm_check_relocs): Skip check for pic format after
processing a vxWorks R_ARM_ABS12 reloc.
* elflink.c (bfd_elf_final_link): Check for ELFCLASSNONE when
reporting a class mismatch.
* testsuite/ld-arm/vxworks1-lib.dd: Update for current
disassmebler output.
* testsuite/ld-arm/vxworks1-lib.rd: Likewise.
* testsuite/ld-arm/vxworks1.dd: Likewise.
* testsuite/ld-arm/vxworks1.rd: Likewise.
* testsuite/ld-arm/vxworks1.ld: Set the output format.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 10 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 6 | ||||
-rw-r--r-- | bfd/elflink.c | 17 |
3 files changed, 27 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c4fd0bb..8de494b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2016-01-21 Nick Clifton <nickc@redhat.com> + + PR ld/19455 + * elf32-arm.c (elf32_arm_create_dynamic_sections): Set the ELF + class of the linker stub bfd. + (elf32_arm_check_relocs): Skip check for pic format after + processing a vxWorks R_ARM_ABS12 reloc. + * elflink.c (bfd_elf_final_link): Check for ELFCLASSNONE when + reporting a class mismatch. + 2016-01-21 Jiong Wang <jiong.wang@arm.com> * elfnn-aarch64.c (aarch64_type_of_stub): Allow insert long branch diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 39b6153..81ebf67 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3575,6 +3575,9 @@ elf32_arm_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) htab->plt_entry_size = 4 * ARRAY_SIZE (elf32_arm_vxworks_exec_plt_entry); } + + if (elf_elfheader (dynobj)) + elf_elfheader (dynobj)->e_ident[EI_CLASS] = ELFCLASS32; } else { @@ -13613,6 +13616,8 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, may_need_local_target_p = TRUE; break; } + else goto jump_over; + /* Fall through. */ case R_ARM_MOVW_ABS_NC: @@ -13632,6 +13637,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, /* Fall through. */ case R_ARM_ABS32: case R_ARM_ABS32_NOI: + jump_over: if (h != NULL && bfd_link_executable (info)) { h->pointer_equality_needed = 1; diff --git a/bfd/elflink.c b/bfd/elflink.c index 5163ad7..e71cb50 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -11395,15 +11395,20 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) { const char *iclass, *oclass; - if (bed->s->elfclass == ELFCLASS64) + switch (bed->s->elfclass) { - iclass = "ELFCLASS32"; - oclass = "ELFCLASS64"; + case ELFCLASS64: oclass = "ELFCLASS64"; break; + case ELFCLASS32: oclass = "ELFCLASS32"; break; + case ELFCLASSNONE: oclass = "ELFCLASSNONE"; break; + default: abort (); } - else + + switch (elf_elfheader (sub)->e_ident[EI_CLASS]) { - iclass = "ELFCLASS64"; - oclass = "ELFCLASS32"; + case ELFCLASS64: iclass = "ELFCLASS64"; break; + case ELFCLASS32: iclass = "ELFCLASS32"; break; + case ELFCLASSNONE: iclass = "ELFCLASSNONE"; break; + default: abort (); } bfd_set_error (bfd_error_wrong_format); |