diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-08-17 07:50:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-08-17 07:50:30 +0000 |
commit | 0035bd7bdae8fe325e8ad63ef07896f5594e229b (patch) | |
tree | c1dd98035145695bf01372975b07abc0deabf064 /bfd/elflink.h | |
parent | c31fd3fe9f6ba788a09e64c6523bd5d2f79e31f6 (diff) | |
download | gdb-0035bd7bdae8fe325e8ad63ef07896f5594e229b.zip gdb-0035bd7bdae8fe325e8ad63ef07896f5594e229b.tar.gz gdb-0035bd7bdae8fe325e8ad63ef07896f5594e229b.tar.bz2 |
* elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC
for special section symbols.
* elflink.h (elf_merge_symbol): If we have no old BFD, check
BSF_DYNAMIC on the section symbol to see whether the old BFD is
dynamic.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index c325c3e..f6727a6 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -384,10 +384,35 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, else newdyn = false; - if (oldbfd == NULL || (oldbfd->flags & DYNAMIC) == 0) - olddyn = false; + if (oldbfd != NULL) + olddyn = (oldbfd->flags & DYNAMIC) != 0; else - olddyn = true; + { + asection *hsec; + + /* This code handles the special SHN_MIPS_{TEXT,DATA} section + indices used by MIPS ELF. */ + switch (h->root.type) + { + default: + hsec = NULL; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + hsec = h->root.u.def.section; + break; + + case bfd_link_hash_common: + hsec = h->root.u.c.p->section; + break; + } + + if (hsec == NULL) + olddyn = false; + else + olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0; + } /* NEWDEF and OLDDEF indicate whether the new or old symbol, respectively, appear to be a definition rather than reference. */ |