aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-02-26 18:35:56 +0000
committerIan Lance Taylor <ian@airs.com>1997-02-26 18:35:56 +0000
commitfa802cb057576e19a6e6fe4c4609ba695676eee4 (patch)
tree8912274e8f6bea5e5407a976096dc8accbedc416 /bfd/elflink.h
parent7a5157080c56a10a2dd3105e2b6f4c8a4820047a (diff)
downloadgdb-fa802cb057576e19a6e6fe4c4609ba695676eee4.zip
gdb-fa802cb057576e19a6e6fe4c4609ba695676eee4.tar.gz
gdb-fa802cb057576e19a6e6fe4c4609ba695676eee4.tar.bz2
* elflink.h (elf_link_input_bfd): Don't skip symbols from sections
that have no contents merely because linker_mark is not set.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index a4a7fc4..3218ac3 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -3863,12 +3863,14 @@ elf_link_input_bfd (finfo, input_bfd)
continue;
/* If this symbol is defined in a section which we are
- discarding, we don't need to keep it. For the benefit of the
- MIPS ELF linker, we check SEC_EXCLUDE as well as linker_mark. */
+ discarding, we don't need to keep it, but note that
+ linker_mark is only reliable for sections that have contents.
+ For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE
+ as well as linker_mark. */
if (isym->st_shndx > 0
&& isym->st_shndx < SHN_LORESERVE
&& isec != NULL
- && (! isec->linker_mark
+ && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
|| (! finfo->info->relocateable
&& (isec->flags & SEC_EXCLUDE) != 0)))
continue;