diff options
Diffstat (limited to 'sys-devel/binutils/files/2.14/binutils-2.14.90.0.7-ppc-reloc.patch')
-rw-r--r-- | sys-devel/binutils/files/2.14/binutils-2.14.90.0.7-ppc-reloc.patch | 1251 |
1 files changed, 0 insertions, 1251 deletions
diff --git a/sys-devel/binutils/files/2.14/binutils-2.14.90.0.7-ppc-reloc.patch b/sys-devel/binutils/files/2.14/binutils-2.14.90.0.7-ppc-reloc.patch deleted file mode 100644 index f73d979b2117..000000000000 --- a/sys-devel/binutils/files/2.14/binutils-2.14.90.0.7-ppc-reloc.patch +++ /dev/null @@ -1,1251 +0,0 @@ -From: Alan Modra <amodra at bigpond dot net dot au> - -bfd/ChangeLog - * elf.c (_bfd_elf_rela_local_sym): Accept asection **, and return - updated section in case of merged section. - * elf-bfd.h (_bfd_elf_rela_local_sym): Update declaration. - * elf-hppa.h (elf_hppa_relocate_section): Adjust call. - * elf-m10200.c (mn10200_elf_relocate_section): Likewise. - * elf-m10300.c (mn10300_elf_relocate_section): Likewise. - * elf32-arm.h (elf32_arm_relocate_section): Likewise. - * elf32-avr.c (elf32_avr_relocate_section): Likewise. - * elf32-cris.c (cris_elf_relocate_section): Likewise. - * elf32-fr30.c (fr30_elf_relocate_section): Likewise. - * elf32-frv.c (elf32_frv_relocate_section): Likewise. - * elf32-h8300.c (elf32_h8_relocate_section): Likewise. - * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-i860.c (elf32_i860_relocate_section): Likewise. - * elf32-m32r.c (m32r_elf_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-mcore.c (mcore_elf_relocate_section): Likewise. - * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. - * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-s390.c (elf_s390_relocate_section): Likewise. - * elf32-sh.c (sh_elf_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf32-v850.c (v850_elf_relocate_section) Likewise. - * elf32-vax.c (elf_vax_relocate_section): Likewise. - * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. - * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. - * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. - * elf64-mmix.c (mmix_elf_relocate_section): Likewise. - * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. - * elf64-s390.c (elf_s390_relocate_section): Likewise. - * elf64-sh64.c (sh_elf64_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. - * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. - - * elf32-cris.c (cris_elf_relocate_section): Don't recalculate symbol - section for reloc output. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf32-vax.c (elf_vax_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. - - * elf32-ppc.c (ppc_elf_relocate_section): Don't recalculate everything - for R_PPC_RELAX32 reloc. Don't bother checking ppc_elf_install_value - return value. - * elf64-ppc.c (ppc64_elf_relocate_section <R_PPC64_TOC>): Sanity check - sec->id. - - * elf/ppc.h (R_PPC_RELAX32PC): Define. - - * elf32-ppc.c (ppc_elf_howto_raw); Add entry for R_PPC_RELAX32PC. - (ppc_elf_install_value): Handle R_PPC_RELAX32PC. Merge duplicate - cases. - (shared_stub_entry): Correct opcode. - (ppc_elf_relax_section): Generate R_PPC_RELAX32PC relocs. - (ppc_elf_relocate_section): Handle them. - - * elf32-ppc.c (ppc_elf_install_value): Delete. - (shared_stub_entry, stub_entry): Make them arrays of ints. - Remove initial branch. - (ppc_elf_relax_section): Write one branch around all trampolines - instead. Correct bogus R_PPC_PLTREL24 handling. Correct - branch range check. Only use shared_stub_entry when shared. - Test that branches can reach stubs. Write trampolines out at - end so that just one realloc is used. Handle little-endian - mode. Move relevant code from ppc_elf_install_value to here. - (ppc_elf_relocate_section): Move code handling RELAX32 from - ppc_elf_install_value to here. - -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf-bfd.h binutils-2.14.90.0.7/bfd/elf-bfd.h ---- binutils-2.14.90.0.7.orig/bfd/elf-bfd.h 2003-11-07 00:11:22.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf-bfd.h 2003-11-07 00:21:15.000000000 +0100 -@@ -1303,7 +1303,7 @@ - extern enum elf_reloc_type_class _bfd_elf_reloc_type_class - (const Elf_Internal_Rela *); - extern bfd_vma _bfd_elf_rela_local_sym -- (bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *); -+ (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *); - extern bfd_vma _bfd_elf_rel_local_sym - (bfd *, Elf_Internal_Sym *, asection **, bfd_vma); - extern bfd_vma _bfd_elf_section_offset -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf-hppa.h binutils-2.14.90.0.7/bfd/elf-hppa.h ---- binutils-2.14.90.0.7.orig/bfd/elf-hppa.h 2003-11-07 00:11:17.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf-hppa.h 2003-11-07 00:21:15.000000000 +0100 -@@ -1346,7 +1346,7 @@ - /* This is a local symbol. */ - sym = local_syms + r_symndx; - sym_sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel); - - /* If this symbol has an entry in the PA64 dynamic hash - table, then get it. */ -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf-m10200.c binutils-2.14.90.0.7/bfd/elf-m10200.c ---- binutils-2.14.90.0.7.orig/bfd/elf-m10200.c 2003-11-07 00:11:14.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf-m10200.c 2003-11-07 00:21:15.000000000 +0100 -@@ -373,7 +373,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf-m10300.c binutils-2.14.90.0.7/bfd/elf-m10300.c ---- binutils-2.14.90.0.7.orig/bfd/elf-m10300.c 2003-11-07 00:11:15.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf-m10300.c 2003-11-07 00:21:15.000000000 +0100 -@@ -1574,7 +1574,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf.c binutils-2.14.90.0.7/bfd/elf.c ---- binutils-2.14.90.0.7.orig/bfd/elf.c 2003-11-07 00:11:20.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf.c 2003-11-07 00:21:15.000000000 +0100 -@@ -7367,9 +7367,10 @@ - bfd_vma - _bfd_elf_rela_local_sym (bfd *abfd, - Elf_Internal_Sym *sym, -- asection *sec, -+ asection **psec, - Elf_Internal_Rela *rel) - { -+ asection *sec = *psec; - bfd_vma relocation; - - relocation = (sec->output_section->vma -@@ -7379,16 +7380,14 @@ - && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && sec->sec_info_type == ELF_INFO_TYPE_MERGE) - { -- asection *msec; -- -- msec = sec; - rel->r_addend = -- _bfd_merged_section_offset (abfd, &msec, -+ _bfd_merged_section_offset (abfd, psec, - elf_section_data (sec)->sec_info, - sym->st_value + rel->r_addend, -- 0) -- - relocation; -- rel->r_addend += msec->output_section->vma + msec->output_offset; -+ 0); -+ sec = *psec; -+ rel->r_addend -= relocation; -+ rel->r_addend += sec->output_section->vma + sec->output_offset; - } - return relocation; - } -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-arm.h binutils-2.14.90.0.7/bfd/elf32-arm.h ---- binutils-2.14.90.0.7.orig/bfd/elf32-arm.h 2003-11-07 00:11:24.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-arm.h 2003-11-07 00:21:15.000000000 +0100 -@@ -1958,7 +1958,7 @@ - bfd_put_32 (input_bfd, value, contents + rel->r_offset); - } - #else -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - #endif - } - else -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-avr.c binutils-2.14.90.0.7/bfd/elf32-avr.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-avr.c 2003-11-07 00:11:15.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-avr.c 2003-11-07 00:21:15.000000000 +0100 -@@ -750,7 +750,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-cris.c binutils-2.14.90.0.7/bfd/elf32-cris.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-cris.c 2003-11-07 00:11:19.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-cris.c 2003-11-07 00:21:15.000000000 +0100 -@@ -847,7 +847,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - symname = (bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name)); -@@ -1292,16 +1292,7 @@ - { - long indx; - -- if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ if (bfd_is_abs_section (sec)) - indx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c binutils-2.14.90.0.7/bfd/elf32-fr30.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-fr30.c 2003-11-07 00:11:22.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-fr30.c 2003-11-07 00:21:15.000000000 +0100 -@@ -552,7 +552,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-frv.c binutils-2.14.90.0.7/bfd/elf32-frv.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-frv.c 2003-11-07 00:11:13.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-frv.c 2003-11-07 00:21:15.000000000 +0100 -@@ -724,7 +724,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c binutils-2.14.90.0.7/bfd/elf32-h8300.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-h8300.c 2003-11-07 00:11:18.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-h8300.c 2003-11-07 00:21:15.000000000 +0100 -@@ -435,7 +435,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c binutils-2.14.90.0.7/bfd/elf32-hppa.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-hppa.c 2003-11-07 00:11:23.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-hppa.c 2003-11-07 00:21:15.000000000 +0100 -@@ -3408,7 +3408,7 @@ - /* This is a local symbol, h defaults to NULL. */ - sym = local_syms + r_symndx; - sym_sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sym_sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-i370.c binutils-2.14.90.0.7/bfd/elf32-i370.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-i370.c 2003-11-07 00:11:22.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-i370.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1210,7 +1210,7 @@ - sec = local_sections[r_symndx]; - sym_name = "<local symbol>"; - -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - addend = rel->r_addend; - } - else -@@ -1363,16 +1363,7 @@ - { - long indx; - -- if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ if (bfd_is_abs_section (sec)) - indx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-i860.c binutils-2.14.90.0.7/bfd/elf32-i860.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-i860.c 2003-11-07 00:11:16.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-i860.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1104,7 +1104,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c binutils-2.14.90.0.7/bfd/elf32-m32r.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-m32r.c 2003-11-07 00:11:22.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-m32r.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1107,7 +1107,7 @@ - sec = local_sections[r_symndx]; - sym_name = "<local symbol>"; - #if !USE_REL -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - addend = rel->r_addend; - #else - /* FIXME: This won't handle local relocations against SEC_MERGE -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c binutils-2.14.90.0.7/bfd/elf32-m68k.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-m68k.c 2003-11-07 00:11:22.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-m68k.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1403,7 +1403,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -@@ -1657,16 +1657,7 @@ - { - long indx; - -- if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ if (bfd_is_abs_section (sec)) - indx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c binutils-2.14.90.0.7/bfd/elf32-mcore.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-mcore.c 2003-11-07 00:11:15.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-mcore.c 2003-11-07 00:21:16.000000000 +0100 -@@ -467,7 +467,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - addend = rel->r_addend; - } - else -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c binutils-2.14.90.0.7/bfd/elf32-msp430.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-msp430.c 2003-11-07 00:11:24.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-msp430.c 2003-11-07 00:21:16.000000000 +0100 -@@ -449,7 +449,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c binutils-2.14.90.0.7/bfd/elf32-openrisc.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-openrisc.c 2003-11-07 00:11:23.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-openrisc.c 2003-11-07 00:21:16.000000000 +0100 -@@ -375,7 +375,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c binutils-2.14.90.0.7/bfd/elf32-ppc.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-ppc.c 2003-11-07 00:11:21.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-ppc.c 2003-11-07 00:27:00.000000000 +0100 -@@ -1534,7 +1534,7 @@ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - -- /* Phony reloc to handle branch stubs. */ -+ /* Phony relocs to handle branch stubs. */ - HOWTO (R_PPC_RELAX32, /* type */ - 0, /* rightshift */ - 0, /* size */ -@@ -1549,6 +1549,20 @@ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - -+ HOWTO (R_PPC_RELAX32PC, /* type */ -+ 0, /* rightshift */ -+ 0, /* size */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_PPC_RELAX32PC", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ - /* GNU extension to record C++ vtable hierarchy. */ - HOWTO (R_PPC_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ -@@ -1614,90 +1628,26 @@ - } - } - --static bfd_reloc_status_type --ppc_elf_install_value (bfd *abfd, -- bfd_byte *hit_addr, -- bfd_vma v, -- unsigned int r_type) --{ -- bfd_vma t0, t1; --#ifdef BFD_HOST_U_64_BIT -- BFD_HOST_U_64_BIT val = (BFD_HOST_U_64_BIT) v; --#else -- bfd_vma val = v; --#endif -- -- switch (r_type) -- { -- case R_PPC_RELAX32: -- /* Do stuff here. */ -- t0 = bfd_get_32 (abfd, hit_addr); -- t1 = bfd_get_32 (abfd, hit_addr + 4); -- -- /* We're clearing the bits for R_PPC_ADDR16_HA -- and R_PPC_ADDR16_LO here. */ -- t0 &= ~0xffff; -- t1 &= ~0xffff; -- -- /* t0 is HA, t1 is lo */ -- t0 |= ((val + 0x8000) >> 16) & 0xffff; -- t1 |= val & 0xffff; -- -- bfd_put_32 (abfd, t0, hit_addr); -- bfd_put_32 (abfd, t1, hit_addr + 4); -- break; -- -- case R_PPC_REL24: -- t0 = bfd_get_32 (abfd, hit_addr); -- t0 &= ~0x3fffffc; -- t0 |= val & 0x3fffffc; -- bfd_put_32 (abfd, t0, hit_addr); -- break; -- -- case R_PPC_REL14: -- case R_PPC_REL14_BRTAKEN: -- case R_PPC_REL14_BRNTAKEN: -- t0 = bfd_get_32 (abfd, hit_addr); -- t0 &= ~0xfffc; -- t0 |= val & 0xfffc; -- bfd_put_32 (abfd, t0, hit_addr); -- break; -- -- case R_PPC_LOCAL24PC: -- case R_PPC_PLTREL24: -- t0 = bfd_get_32 (abfd, hit_addr); -- t0 &= ~0x3fffffc; -- t0 |= val & 0x3fffffc; -- bfd_put_32 (abfd, t0, hit_addr); -- break; -- -- default: -- return bfd_reloc_notsupported; -- } -+#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) - -- return bfd_reloc_ok; --} -- --static const bfd_byte shared_stub_entry[] = -+static const int shared_stub_entry[] = - { -- 0x48, 0x00, 0x00, 0x24, /* b .+36 */ -- 0x7c, 0x08, 0x02, 0xa6, /* mflr 0 */ -- 0x42, 0x9f, 0x00, 0x05, /* bcl 20, 31, .Lxxx */ -- 0x7d, 0x68, 0x02, 0xa6, /* mflr 11 */ -- 0x3d, 0x60, 0x00, 0x00, /* addis 11, 11, (xxx-.Lxxx)@ha */ -- 0x39, 0x6b, 0x00, 0x18, /* addi 11, 11, (xxx-.Lxxx)@l */ -- 0x7c, 0x08, 0x03, 0xa6, /* mtlr 0 */ -- 0x7d, 0x69, 0x03, 0xa6, /* mtctr 11 */ -- 0x4e, 0x80, 0x04, 0x20, /* bctr */ -+ 0x7c0802a6, /* mflr 0 */ -+ 0x429f0005, /* bcl 20, 31, .Lxxx */ -+ 0x7d6802a6, /* mflr 11 */ -+ 0x3d6b0000, /* addis 11, 11, (xxx-.Lxxx)@ha */ -+ 0x396b0018, /* addi 11, 11, (xxx-.Lxxx)@l */ -+ 0x7c0803a6, /* mtlr 0 */ -+ 0x7d6903a6, /* mtctr 11 */ -+ 0x4e800420, /* bctr */ - }; - --static const bfd_byte stub_entry[] = -+static const int stub_entry[] = - { -- 0x48, 0x00, 0x00, 0x14, /* b .+20 */ -- 0x3d, 0x60, 0x00, 0x00, /* lis 11,xxx@ha */ -- 0x39, 0x6b, 0x00, 0x00, /* addi 11,11,xxx@l */ -- 0x7d, 0x69, 0x03, 0xa6, /* mtctr 11 */ -- 0x4e, 0x80, 0x04, 0x20, /* bctr */ -+ 0x3d600000, /* lis 11,xxx@ha */ -+ 0x396b0000, /* addi 11,11,xxx@l */ -+ 0x7d6903a6, /* mtctr 11 */ -+ 0x4e800420, /* bctr */ - }; - - -@@ -1721,9 +1671,9 @@ - Elf_Internal_Rela *internal_relocs = NULL; - Elf_Internal_Rela *irel, *irelend; - struct one_fixup *fixups = NULL; -- bfd_boolean changed_contents = FALSE; -- bfd_boolean changed_relocs = FALSE; -+ bfd_boolean changed; - struct ppc_elf_link_hash_table *ppc_info; -+ bfd_size_type trampoff; - - *again = FALSE; - -@@ -1738,6 +1688,10 @@ - if (isec->_cooked_size == 0) - isec->_cooked_size = isec->_raw_size; - -+ trampoff = (isec->_cooked_size + 3) & (bfd_vma) -4; -+ /* Space for a branch around any trampolines. */ -+ trampoff += 4; -+ - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - - /* Get a copy of the native relocations. */ -@@ -1767,21 +1721,26 @@ - for (irel = internal_relocs; irel < irelend; irel++) - { - unsigned long r_type = ELF32_R_TYPE (irel->r_info); -- bfd_vma symaddr, reladdr, trampoff, toff, roff; -+ bfd_vma symaddr, reladdr, toff, roff; - asection *tsec; -- bfd_size_type amt; - struct one_fixup *f; - size_t insn_offset = 0; -- bfd_vma max_branch_offset; -+ bfd_vma max_branch_offset, val; -+ bfd_byte *hit_addr; -+ unsigned long t0; - - switch (r_type) - { - case R_PPC_REL24: - case R_PPC_LOCAL24PC: -+ case R_PPC_PLTREL24: -+ max_branch_offset = 1 << 25; -+ break; -+ - case R_PPC_REL14: - case R_PPC_REL14_BRTAKEN: - case R_PPC_REL14_BRNTAKEN: -- case R_PPC_PLTREL24: -+ max_branch_offset = 1 << 15; - break; - - default: -@@ -1819,7 +1778,7 @@ - } - else - { -- /* Need dynamic symbol handling. */ -+ /* Global symbol handling. */ - unsigned long indx; - struct elf_link_hash_entry *h; - -@@ -1830,62 +1789,34 @@ - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - -- if (r_type == R_PPC_PLTREL24) -+ if (r_type == R_PPC_PLTREL24 -+ && ppc_info->plt != NULL -+ && h->plt.offset != (bfd_vma) -1) - { -- Elf_Internal_Sym *isym; -- -- if (h->plt.offset == (bfd_vma) -1 -- || ppc_info->plt == NULL) -- { -- -- /* Read this BFD's local symbols. */ -- if (isymbuf == NULL) -- { -- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; -- if (isymbuf == NULL) -- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, -- symtab_hdr->sh_info, 0, -- NULL, NULL, NULL); -- if (isymbuf == 0) -- goto error_return; -- } -- isym = isymbuf + ELF32_R_SYM (irel->r_info); -- -- if (isym->st_shndx == SHN_UNDEF) -- /* We can't do anthing with undefined symbols. */ -- continue; -- else if (isym->st_shndx == SHN_ABS) -- tsec = bfd_abs_section_ptr; -- else if (isym->st_shndx == SHN_COMMON) -- tsec = bfd_com_section_ptr; -- else -- tsec = h->root.u.def.section; -- -- toff = h->root.u.def.value; -- } -- else -- { -- tsec = ppc_info->plt; -- toff = h->plt.offset; -- } -+ tsec = ppc_info->plt; -+ toff = h->plt.offset; - } -- else if (h->root.type == bfd_link_hash_undefined -- || h->root.type == bfd_link_hash_undefweak) -- continue; -- -- else -+ else if (h->root.type == bfd_link_hash_defined -+ || h->root.type == bfd_link_hash_defweak) - { - tsec = h->root.u.def.section; - toff = h->root.u.def.value; - } -+ else -+ continue; - } - -+ /* If the branch and target are in the same section, you have -+ no hope of adding stubs. We'll error out later should the -+ branch overflow. */ -+ if (tsec == isec) -+ continue; -+ -+ toff += irel->r_addend; - if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE) - toff = _bfd_merged_section_offset (abfd, &tsec, - elf_section_data (tsec)->sec_info, -- toff + irel->r_addend, 0); -- else -- toff += irel->r_addend; -+ toff, 0); - - symaddr = tsec->output_section->vma + tsec->output_offset + toff; - -@@ -1893,22 +1824,10 @@ - - reladdr = (isec->output_section->vma - + isec->output_offset -- + roff) & (bfd_vma) -4; -+ + roff); - - /* If the branch is in range, no need to do anything. */ -- max_branch_offset = 1 << 25; -- if (r_type != R_PPC_REL24 -- && r_type != R_PPC_LOCAL24PC -- && r_type != R_PPC_PLTREL24) -- max_branch_offset = 1 << 15; -- -- if ((bfd_vma) (symaddr - reladdr) + max_branch_offset -- <= 2 * max_branch_offset) -- continue; -- -- /* If the branch and target are in the same section, you have -- no hope. We'll error out later. */ -- if (tsec == isec) -+ if (symaddr - reladdr + max_branch_offset < 2 * max_branch_offset) - continue; - - /* Look for an existing fixup to this address. */ -@@ -1919,40 +1838,31 @@ - if (f == NULL) - { - size_t size; -+ unsigned long stub_rtype; - -- if (link_info->shared -- || tsec == ppc_info->plt -- || r_type == R_PPC_LOCAL24PC) -+ val = trampoff - roff; -+ if (val >= max_branch_offset) -+ /* Oh dear, we can't reach a trampoline. Don't try to add -+ one. We'll report an error later. */ -+ continue; -+ -+ if (link_info->shared) - { -- size = sizeof (shared_stub_entry); -- insn_offset = 16; -+ size = 4 * ARRAY_SIZE (shared_stub_entry); -+ insn_offset = 12; -+ stub_rtype = R_PPC_RELAX32PC; - } - else - { -- size = sizeof (stub_entry); -- insn_offset = 4; -+ size = 4 * ARRAY_SIZE (stub_entry); -+ insn_offset = 0; -+ stub_rtype = R_PPC_RELAX32; - } - -- /* Resize the current section to make room for the new branch. */ -- trampoff = (isec->_cooked_size + 3) & (bfd_vma) - 4; -- amt = trampoff + size; -- contents = bfd_realloc (contents, amt); -- if (contents == NULL) -- abort (); -- -- isec->_cooked_size = amt; -- -- if (link_info->shared -- || tsec == ppc_info->plt -- || r_type == R_PPC_LOCAL24PC) -- memcpy (contents + trampoff, shared_stub_entry, size); -- else -- memcpy (contents + trampoff, stub_entry, size); -- - /* Hijack the old relocation. Since we need two - relocations for this use a "composite" reloc. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), -- R_PPC_RELAX32); -+ stub_rtype); - irel->r_offset = trampoff + insn_offset; - - /* Record the fixup so we don't do it again this section. */ -@@ -1962,31 +1872,95 @@ - f->toff = toff; - f->trampoff = trampoff; - fixups = f; -+ -+ trampoff += size; - } - else - { -+ val = f->trampoff - roff; -+ if (val >= max_branch_offset) -+ continue; -+ - /* Nop out the reloc, since we're finalizing things here. */ - irel->r_info = ELF32_R_INFO (0, R_PPC_NONE); - } - -- /* Fix up the existing branch to hit the trampoline. Hope like -- hell this doesn't overflow too. */ -- if (ppc_elf_install_value (abfd, contents + roff, -- f->trampoff - (roff & (bfd_vma) -3) + 4, -- r_type) != bfd_reloc_ok) -- abort (); -+ /* Fix up the existing branch to hit the trampoline. */ -+ hit_addr = contents + roff; -+ switch (r_type) -+ { -+ case R_PPC_REL24: -+ case R_PPC_LOCAL24PC: -+ case R_PPC_PLTREL24: -+ t0 = bfd_get_32 (abfd, hit_addr); -+ t0 &= ~0x3fffffc; -+ t0 |= val & 0x3fffffc; -+ bfd_put_32 (abfd, t0, hit_addr); -+ break; - -- changed_contents = TRUE; -- changed_relocs = TRUE; -+ case R_PPC_REL14: -+ case R_PPC_REL14_BRTAKEN: -+ case R_PPC_REL14_BRNTAKEN: -+ t0 = bfd_get_32 (abfd, hit_addr); -+ t0 &= ~0xfffc; -+ t0 |= val & 0xfffc; -+ bfd_put_32 (abfd, t0, hit_addr); -+ break; -+ } - } - -- /* Clean up. */ -- while (fixups) -+ /* Write out the trampolines. */ -+ changed = fixups != NULL; -+ if (fixups != NULL) - { -- struct one_fixup *f = fixups; -- fixups = fixups->next; -- free (f); -+ const int *stub; -+ bfd_byte *dest; -+ bfd_vma val; -+ int i, size; -+ -+ do -+ { -+ struct one_fixup *f = fixups; -+ fixups = fixups->next; -+ free (f); -+ } -+ while (fixups); -+ -+ contents = bfd_realloc (contents, trampoff); -+ if (contents == NULL) -+ goto error_return; -+ -+ isec->_cooked_size = (isec->_cooked_size + 3) & (bfd_vma) -4; -+ /* Branch around the trampolines. */ -+ val = trampoff - isec->_cooked_size + 0x48000000; -+ dest = contents + isec->_cooked_size; -+ isec->_cooked_size = trampoff; -+ bfd_put_32 (abfd, val, dest); -+ dest += 4; -+ -+ if (link_info->shared) -+ { -+ stub = shared_stub_entry; -+ size = ARRAY_SIZE (shared_stub_entry); -+ } -+ else -+ { -+ stub = stub_entry; -+ size = ARRAY_SIZE (stub_entry); -+ } -+ -+ i = 0; -+ while (dest < contents + trampoff) -+ { -+ bfd_put_32 (abfd, stub[i], dest); -+ i++; -+ if (i == size) -+ i = 0; -+ dest += 4; -+ } -+ BFD_ASSERT (i == 0); - } -+ - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) - { -@@ -2002,7 +1976,7 @@ - if (contents != NULL - && elf_section_data (isec)->this_hdr.contents != contents) - { -- if (!changed_contents && !link_info->keep_memory) -+ if (!changed && !link_info->keep_memory) - free (contents); - else - { -@@ -2013,13 +1987,13 @@ - - if (elf_section_data (isec)->relocs != internal_relocs) - { -- if (!changed_relocs) -+ if (!changed) - free (internal_relocs); - else - elf_section_data (isec)->relocs = internal_relocs; - } - -- *again = changed_contents || changed_relocs; -+ *again = changed; - return TRUE; - - error_return: -@@ -4727,7 +4701,7 @@ - sec = local_sections[r_symndx]; - sym_name = bfd_elf_local_sym_name (input_bfd, sym); - -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -@@ -5454,45 +5428,33 @@ - } - break; - -+ case R_PPC_RELAX32PC: -+ relocation -= (input_section->output_section->vma -+ + input_section->output_offset -+ + rel->r_offset - 4); -+ /* Fall thru */ - case R_PPC_RELAX32: - { -- unsigned long r_symndx; -- Elf_Internal_Sym *sym; -- asection *sym_sec; -- bfd_byte *hit_addr = 0; -- bfd_vma value = 0; -+ unsigned long t0; -+ unsigned long t1; - -- r_symndx = ELF32_R_SYM (rel->r_info); -- -- if (r_symndx < symtab_hdr->sh_info) -- { -- sym = local_syms + r_symndx; -- sym_sec = local_sections[r_symndx]; -- -- value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel); -- } -- else -- { -- bfd_boolean warned; -- bfd_boolean unresolved_reloc; -+ t0 = bfd_get_32 (output_bfd, contents + rel->r_offset); -+ t1 = bfd_get_32 (output_bfd, contents + rel->r_offset + 4); - -- RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd), -- r_symndx, symtab_hdr, -- value, sym_sec, -- unresolved_reloc, info, -- warned); -- if (warned) -- continue; -- } -- hit_addr = contents + rel->r_offset; -- value += rel->r_addend; -+ /* We're clearing the bits for R_PPC_ADDR16_HA -+ and R_PPC_ADDR16_LO here. */ -+ t0 &= ~0xffff; -+ t1 &= ~0xffff; -+ -+ /* t0 is HA, t1 is LO */ -+ relocation += addend; -+ t0 |= ((relocation + 0x8000) >> 16) & 0xffff; -+ t1 |= relocation & 0xffff; - -- r = ppc_elf_install_value (output_bfd, hit_addr, value, r_type); -- if (r != bfd_reloc_ok) -- break; -- else -- continue; -+ bfd_put_32 (output_bfd, t0, contents + rel->r_offset); -+ bfd_put_32 (output_bfd, t1, contents + rel->r_offset + 4); - } -+ continue; - - /* Indirect .sdata relocation. */ - case R_PPC_EMB_SDAI16: -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-s390.c binutils-2.14.90.0.7/bfd/elf32-s390.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-s390.c 2003-11-07 00:11:15.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-s390.c 2003-11-07 00:21:16.000000000 +0100 -@@ -2325,7 +2325,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-sh.c binutils-2.14.90.0.7/bfd/elf32-sh.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-sh.c 2003-11-07 00:11:14.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-sh.c 2003-11-07 00:21:16.000000000 +0100 -@@ -4805,7 +4805,7 @@ - } - else if (! howto->partial_inplace) - { -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - addend = rel->r_addend; - } - else if ((sec->flags & SEC_MERGE) -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c binutils-2.14.90.0.7/bfd/elf32-sparc.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-sparc.c 2003-11-07 00:11:25.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-sparc.c 2003-11-07 00:21:16.000000000 +0100 -@@ -2460,16 +2460,8 @@ - - if (is_plt) - sec = htab->splt; -- else if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ -+ if (bfd_is_abs_section (sec)) - indx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-v850.c binutils-2.14.90.0.7/bfd/elf32-v850.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-v850.c 2003-11-07 00:11:24.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-v850.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1681,7 +1681,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - #if 0 - { - char * name; -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-vax.c binutils-2.14.90.0.7/bfd/elf32-vax.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-vax.c 2003-11-07 00:11:13.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-vax.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1483,7 +1483,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -@@ -1737,16 +1737,7 @@ - { - long indx; - -- if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ if (bfd_is_abs_section (sec)) - indx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c binutils-2.14.90.0.7/bfd/elf32-xstormy16.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-xstormy16.c 2003-11-07 00:11:15.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-xstormy16.c 2003-11-07 00:21:16.000000000 +0100 -@@ -845,7 +845,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c binutils-2.14.90.0.7/bfd/elf32-xtensa.c ---- binutils-2.14.90.0.7.orig/bfd/elf32-xtensa.c 2003-11-07 00:11:17.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf32-xtensa.c 2003-11-07 00:21:16.000000000 +0100 -@@ -2004,7 +2004,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c binutils-2.14.90.0.7/bfd/elf64-alpha.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-alpha.c 2003-11-07 00:11:16.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-alpha.c 2003-11-07 00:21:16.000000000 +0100 -@@ -4394,9 +4394,11 @@ - - if (r_symndx < symtab_hdr->sh_info) - { -+ asection *msec; - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ msec = sec; -+ value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel); - - /* If this is a tp-relative relocation against sym 0, - this is hackery from relax_section. Force the value to -@@ -4424,7 +4426,6 @@ - && !gotent->reloc_xlated) - { - struct alpha_elf_got_entry *ent; -- asection *msec; - - for (ent = gotent; ent; ent = ent->next) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c binutils-2.14.90.0.7/bfd/elf64-mmix.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-mmix.c 2003-11-07 00:11:14.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-mmix.c 2003-11-07 00:21:16.000000000 +0100 -@@ -1472,7 +1472,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections [r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - - name = bfd_elf_string_from_elf_section - (input_bfd, symtab_hdr->sh_link, sym->st_name); -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c binutils-2.14.90.0.7/bfd/elf64-ppc.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-ppc.c 2003-11-07 00:11:18.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-ppc.c 2003-11-07 00:21:17.000000000 +0100 -@@ -7385,7 +7385,7 @@ - sec = local_sections[r_symndx]; - sym_name = bfd_elf_local_sym_name (input_bfd, sym); - sym_type = ELF64_ST_TYPE (sym->st_info); -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - if (elf_section_data (sec) != NULL) - { - long *opd_sym_adjust; -@@ -8178,7 +8178,9 @@ - relocation = TOCstart; - if (r_symndx == 0) - relocation += htab->stub_group[input_section->id].toc_off; -- else if (sec != NULL && !unresolved_reloc) -+ else if (unresolved_reloc) -+ ; -+ else if (sec != NULL && sec->id <= htab->top_id) - relocation += htab->stub_group[sec->id].toc_off; - else - unresolved_reloc = TRUE; -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-s390.c binutils-2.14.90.0.7/bfd/elf64-s390.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-s390.c 2003-11-07 00:11:16.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-s390.c 2003-11-07 00:21:17.000000000 +0100 -@@ -2295,7 +2295,7 @@ - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c binutils-2.14.90.0.7/bfd/elf64-sh64.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-sh64.c 2003-11-07 00:11:21.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-sh64.c 2003-11-07 00:21:17.000000000 +0100 -@@ -1582,7 +1582,7 @@ - } - else if (! howto->partial_inplace) - { -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - relocation |= ((sym->st_other & STO_SH5_ISA32) != 0); - } - else if ((sec->flags & SEC_MERGE) -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c binutils-2.14.90.0.7/bfd/elf64-sparc.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-sparc.c 2003-11-07 00:11:24.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-sparc.c 2003-11-07 00:26:02.000000000 +0100 -@@ -2071,7 +2071,7 @@ - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - orig_addend = rel->r_addend; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -@@ -2248,16 +2248,8 @@ - - if (is_plt) - sec = splt; -- else if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ -+ if (bfd_is_abs_section (sec)) - indx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c binutils-2.14.90.0.7/bfd/elf64-x86-64.c ---- binutils-2.14.90.0.7.orig/bfd/elf64-x86-64.c 2003-11-07 00:11:23.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elf64-x86-64.c 2003-11-07 00:21:17.000000000 +0100 -@@ -1823,7 +1823,7 @@ - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { -@@ -2048,16 +2048,7 @@ - { - long sindx; - -- if (h == NULL) -- sec = local_sections[r_symndx]; -- else -- { -- BFD_ASSERT (h->root.type == bfd_link_hash_defined -- || (h->root.type -- == bfd_link_hash_defweak)); -- sec = h->root.u.def.section; -- } -- if (sec != NULL && bfd_is_abs_section (sec)) -+ if (bfd_is_abs_section (sec)) - sindx = 0; - else if (sec == NULL || sec->owner == NULL) - { -diff -ruN binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c binutils-2.14.90.0.7/bfd/elfxx-ia64.c ---- binutils-2.14.90.0.7.orig/bfd/elfxx-ia64.c 2003-11-07 00:11:25.000000000 +0100 -+++ binutils-2.14.90.0.7/bfd/elfxx-ia64.c 2003-11-07 00:21:17.000000000 +0100 -@@ -3848,9 +3848,11 @@ - if (r_symndx < symtab_hdr->sh_info) - { - /* Reloc against local symbol. */ -+ asection *msec; - sym = local_syms + r_symndx; - sym_sec = local_sections[r_symndx]; -- value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel); -+ msec = sym_sec; -+ value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel); - if ((sym_sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE) -@@ -3861,7 +3863,6 @@ - if (loc_h && ! loc_h->sec_merge_done) - { - struct elfNN_ia64_dyn_sym_info *dynent; -- asection *msec; - - for (dynent = loc_h->info; dynent; dynent = dynent->next) - { -diff -ruN binutils-2.14.90.0.7.orig/include/elf/ppc.h binutils-2.14.90.0.7/include/elf/ppc.h ---- binutils-2.14.90.0.7.orig/include/elf/ppc.h 2003-11-07 00:10:33.000000000 +0100 -+++ binutils-2.14.90.0.7/include/elf/ppc.h 2003-11-07 00:26:52.000000000 +0100 -@@ -120,9 +120,10 @@ - RELOC_NUMBER (R_PPC_EMB_BIT_FLD, 115) - RELOC_NUMBER (R_PPC_EMB_RELSDA, 116) - --/* Fake relocation for branch stubs. This will keep them -+/* Fake relocations for branch stubs. This will keep them - together. */ - #define R_PPC_RELAX32 251 -+#define R_PPC_RELAX32PC 252 - - /* These are GNU extensions to enable C++ vtable garbage collection. */ - RELOC_NUMBER (R_PPC_GNU_VTINHERIT, 253) |