Merge patches sent by Robert P. J. Day <rpjday@mindspring.com>.
Warning: the buildroot folks purposedly removed the skip-comment patch but didn't really said why. Keeping it for the sake of having it in svn just in case (removing it will be easier thant not having it at all).
1 2002-04-20 Jakub Jelinek <jakub@redhat.com>
3 * elf32-sparc.c (elf32_sparc_relocate_section): Find real output
4 section with SEC_MERGE.
5 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7 --- binutils/bfd/elf32-sparc.c.jj Sat Apr 20 22:11:57 2002
8 +++ binutils/bfd/elf32-sparc.c Sat Apr 20 23:06:33 2002
9 @@ -1144,7 +1144,7 @@ elf32_sparc_relocate_section (output_bfd
10 struct elf_link_hash_entry *h;
11 Elf_Internal_Sym *sym;
13 - bfd_vma relocation, off;
14 + bfd_vma relocation, off, orig_addend = 0;
15 bfd_reloc_status_type r;
16 boolean is_plt = false;
17 boolean unresolved_reloc;
18 @@ -1192,6 +1192,7 @@ elf32_sparc_relocate_section (output_bfd
20 sym = local_syms + r_symndx;
21 sec = local_sections[r_symndx];
22 + orig_addend = rel->r_addend;
23 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
26 @@ -1527,6 +1528,25 @@ elf32_sparc_relocate_section (output_bfd
29 osec = sec->output_section;
30 + /* FIXME: As soon as making sections zero size
31 + is possible, this if can go away. */
32 + if (bfd_is_abs_section (osec)
34 + && (sec->flags & SEC_MERGE)
35 + && ELF_ST_TYPE (sym->st_info) == STT_SECTION
36 + && (elf_section_data (sec)->sec_info_type
37 + == ELF_INFO_TYPE_MERGE))
42 + _bfd_merged_section_offset (output_bfd, &msec,
43 + elf_section_data (sec)->sec_info,
44 + sym->st_value + orig_addend,
46 + osec = msec->output_section;
49 indx = elf_section_data (osec)->dynindx;
51 /* FIXME: we really should be able to link non-pic
52 --- binutils/bfd/elf64-sparc.c.jj Sat Apr 20 22:11:57 2002
53 +++ binutils/bfd/elf64-sparc.c Sat Apr 20 23:12:18 2002
54 @@ -1939,7 +1939,7 @@ sparc64_elf_relocate_section (output_bfd
55 struct elf_link_hash_entry *h;
56 Elf_Internal_Sym *sym;
58 - bfd_vma relocation, off;
59 + bfd_vma relocation, off, orig_addend = 0;
60 bfd_reloc_status_type r;
61 boolean is_plt = false;
62 boolean unresolved_reloc;
63 @@ -1982,6 +1982,7 @@ sparc64_elf_relocate_section (output_bfd
65 sym = local_syms + r_symndx;
66 sec = local_sections[r_symndx];
67 + orig_addend = rel->r_addend;
68 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
71 @@ -2211,6 +2212,25 @@ sparc64_elf_relocate_section (output_bfd
74 osec = sec->output_section;
75 + /* FIXME: As soon as making sections zero size
76 + is possible, this if can go away. */
77 + if (bfd_is_abs_section (osec)
79 + && (sec->flags & SEC_MERGE)
80 + && ELF_ST_TYPE (sym->st_info) == STT_SECTION
81 + && (elf_section_data (sec)->sec_info_type
82 + == ELF_INFO_TYPE_MERGE))
87 + _bfd_merged_section_offset (output_bfd, &msec,
88 + elf_section_data (sec)->sec_info,
89 + sym->st_value + orig_addend,
91 + osec = msec->output_section;
94 indx = elf_section_data (osec)->dynindx;
96 /* FIXME: we really should be able to link non-pic