diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 19 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 19 |
2 files changed, 27 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2b35ed0..8cc5cbd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-06-10 Alan Modra <amodra@bigpond.net.au> + Gary Hade <garyhade@us.ibm.com> + + * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq. + 2003-06-10 Richard Sandiford <rsandifo@redhat.com> * archures.c (bfd_mach_h8300sxn): New architecture. @@ -116,12 +121,12 @@ * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to R_V850_ABS32. Add entry for R_V850_REL32. - (v850_elf_reloc_map): Likewise. - (v850_elf_check_relocs): Likewise. - (v850_elf_perform_relocation): Likewise. - (v850_elf_final_link_relocate): Likewise. Include computation + (v850_elf_reloc_map): Likewise. + (v850_elf_check_relocs): Likewise. + (v850_elf_perform_relocation): Likewise. + (v850_elf_final_link_relocate): Likewise. Include computation to make R_V850_REl32 pc-relative. - + 2003-06-03 Kaz Kojima <kkojima@rr.iij4u.or.jp> * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section @@ -375,8 +380,8 @@ (allocate_dynrelocs): For undef weak syms with non-default visibility, a) don't allocate plt entries, b) don't allocate .got relocs, c) discard dyn rel space - (sh_elf_relocate_section): d) don't generate .got relocs, e) - don't generate dynamic relocs. + (sh_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 0e7576f..bc47809 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -7315,7 +7315,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; bfd_boolean unresolved_reloc; bfd_boolean warned; - long insn; + long insn, mask; struct ppc_stub_hash_entry *stub_entry; bfd_vma max_br_offset; bfd_vma from; @@ -8406,12 +8406,23 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_TPREL16_LO_DS: case R_PPC64_DTPREL16_DS: case R_PPC64_DTPREL16_LO_DS: - if (((relocation + addend) & 3) != 0) + insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3)); + mask = 3; + /* If this reloc is against an lq insn, then the value must be + a multiple of 16. This is somewhat of a hack, but the + "correct" way to do this by defining _DQ forms of all the + _DS relocs bloats all reloc switches in this file. It + doesn't seem to make much sense to use any of these relocs + in data, so testing the insn should be safe. */ + if ((insn & (0x3f << 26)) == (56 << 26)) + mask = 15; + if (((relocation + addend) & mask) != 0) { (*_bfd_error_handler) - (_("%s: error: relocation %s not a multiple of 4"), + (_("%s: error: relocation %s not a multiple of %d"), bfd_archive_filename (input_bfd), - ppc64_elf_howto_table[(int) r_type]->name); + ppc64_elf_howto_table[(int) r_type]->name, + mask + 1); bfd_set_error (bfd_error_bad_value); ret = FALSE; continue; |