diff options
author | Jakub Jelinek <jakub@redhat.com> | 2001-11-23 13:16:39 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2001-11-23 13:16:39 +0000 |
commit | 2e549b45b82d7d3191799b7650221fb3ebb03293 (patch) | |
tree | 8a4812fd4be29e87fdedf33a9fd39b446bb0533c /bfd | |
parent | f8df10f4f595488c4b6a8e49ffc99721d5aefdba (diff) | |
download | gdb-2e549b45b82d7d3191799b7650221fb3ebb03293.zip gdb-2e549b45b82d7d3191799b7650221fb3ebb03293.tar.gz gdb-2e549b45b82d7d3191799b7650221fb3ebb03293.tar.bz2 |
* elf32-sparc.c (elf32_sparc_relocate_section): Don't clear
relocations in non-alloced sections against global symbols
defined in shared library being built.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-sparc.c | 10 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 10 |
3 files changed, 25 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0b3cd62..a011579 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2001-11-23 Jakub Jelinek <jakub@redhat.com> + * elf32-sparc.c (elf32_sparc_relocate_section): Don't clear + relocations in non-alloced sections against global symbols + defined in shared library being built. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2001-11-23 Jakub Jelinek <jakub@redhat.com> + * elf.c (_bfd_elf_rela_local_sym): New. * elflink.h (elf_link_input_bfd): Don't consider empty merged sections as removed in relocation tests. diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 9458061..60a4dc7 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1221,7 +1221,15 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, || ((r_type == R_SPARC_PC10 || r_type == R_SPARC_PC22) && strcmp (h->root.root.string, - "_GLOBAL_OFFSET_TABLE_") != 0)))) + "_GLOBAL_OFFSET_TABLE_") != 0)) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_SPARC_32 relocations in its + sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 6af2b15..9a91816 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -2053,7 +2053,15 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared && ((!info->symbolic && h->dynindx != -1) || !(h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR))) + & ELF_LINK_HASH_DEF_REGULAR)) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_SPARC_{32,64} relocations in + its sections against symbols defined externally + in shared libraries. We can't do anything + with them here. */ + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0))) skip_it = true; break; } |