From: Ian Lance Taylor Date: Thu, 5 Dec 1996 18:47:03 +0000 (+0000) Subject: * elflink.h (elf_link_add_object_symbols): Calling check_relocs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=80be821d2e1e9b79c44d53b08e25b43c29a236b9;p=binutils-gdb.git * elflink.h (elf_link_add_object_symbols): Calling check_relocs even if SEC_ALLOC is not set. * elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC when deciding whether to copy a reloc into a shared object. (elf_i386_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. (elf32_sparc_relocate_section): Likewise. * elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a reloc section if it is not set in the source section. * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. * elf.c (bfd_section_from_shdr): Mark a reloc section associated with a SEC_DEBUGGING section as SEC_DEBUGGING. PR 11174. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8ca7fc7843d..d8a7ba2c31c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,18 @@ +Thu Dec 5 13:24:46 1996 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): Calling check_relocs + even if SEC_ALLOC is not set. + * elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC + when deciding whether to copy a reloc into a shared object. + (elf_i386_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + (elf32_sparc_relocate_section): Likewise. + * elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a + reloc section if it is not set in the source section. + * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. + * elf.c (bfd_section_from_shdr): Mark a reloc section associated + with a SEC_DEBUGGING section as SEC_DEBUGGING. + Wed Dec 4 14:18:13 1996 Michael Meissner * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): #if 0 code that diff --git a/bfd/elf.c b/bfd/elf.c index 06c6a8b4c36..73c60d31179 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -576,6 +576,7 @@ _bfd_elf_link_hash_newfunc (entry, table, string) ret->plt_offset = (bfd_vma) -1; ret->linker_section_pointer = (elf_linker_section_pointers_t *)0; ret->type = STT_NOTYPE; + ret->other = 0; /* Assume that we have been called by a non-ELF symbol reader. This flag is then reset by the code which reads an ELF input file. This ensures that a symbol created by a non-ELF symbol @@ -863,7 +864,19 @@ bfd_section_from_shdr (abfd, shindex) represent such a section, so at least for now, we don't try. We just present it as a normal section. */ if (hdr->sh_link != elf_onesymtab (abfd)) - return _bfd_elf_make_section_from_shdr (abfd, hdr, name); + { + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + if (hdr->bfd_section != NULL + && bfd_section_from_shdr (abfd, hdr->sh_info)) + { + target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info); + if (target_sect != NULL + && (target_sect->flags & SEC_DEBUGGING) != 0) + hdr->bfd_section->flags |= SEC_DEBUGGING; + } + return true; + } if (! bfd_section_from_shdr (abfd, hdr->sh_info)) return false; @@ -2525,8 +2538,11 @@ prep_headers (abfd) i_ehdrp->e_machine = EM_CYGNUS_M32R; break; /* end-sanitize-m32r */ - case bfd_arch_mn10x00: - i_ehdrp->e_machine = EM_CYGNUS_MN10x00; + case bfd_arch_mn10200: + i_ehdrp->e_machine = EM_CYGNUS_MN10200; + break; + case bfd_arch_mn10300: + i_ehdrp->e_machine = EM_CYGNUS_MN10300; break; /* also note that EM_M32, AT&T WE32100 is unknown to bfd */ default: @@ -3149,7 +3165,11 @@ swap_out_syms (abfd, sttp) sym.st_info = ELF_ST_INFO (bind, type); } - sym.st_other = 0; + if (type_ptr != NULL) + sym.st_other = type_ptr->internal_elf_sym.st_other; + else + sym.st_other = 0; + bed->s->swap_symbol_out (abfd, &sym, (PTR) outbound_syms); outbound_syms += bed->s->sizeof_sym; } diff --git a/bfd/elflink.h b/bfd/elflink.h index 3c8c33956c9..8be2f2d6ab7 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -956,12 +956,6 @@ elf_link_add_object_symbols (abfd, info) || o->reloc_count == 0) continue; - /* I believe we can ignore the relocs for any section which - does not form part of the final process image, such as a - debugging section. */ - if ((o->flags & SEC_ALLOC) == 0) - continue; - internal_relocs = (NAME(_bfd_elf,link_read_relocs) (abfd, o, (PTR) NULL, (Elf_Internal_Rela *) NULL,