aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-12-05 18:47:03 +0000
committerIan Lance Taylor <ian@airs.com>1996-12-05 18:47:03 +0000
commit80be821d2e1e9b79c44d53b08e25b43c29a236b9 (patch)
tree11a4a6d0c75b41b920e6870074e00e7358726558 /bfd/elf.c
parent00a69b895a5ff0836c14a1d7c799963e9f0e10a6 (diff)
downloadgdb-80be821d2e1e9b79c44d53b08e25b43c29a236b9.zip
gdb-80be821d2e1e9b79c44d53b08e25b43c29a236b9.tar.gz
gdb-80be821d2e1e9b79c44d53b08e25b43c29a236b9.tar.bz2
* 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.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 06c6a8b..73c60d3 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;
}