diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-03-27 19:21:19 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-03-27 19:21:19 +0000 |
commit | 7ec49f9133feadc43acc49b1ee00674ecb9c1c15 (patch) | |
tree | 15b0a0e3a31c92bfb1c22001426f2a84fb255ce3 /bfd/xcofflink.c | |
parent | cf2e4f5fdee71e74fac6d295e642375db2e9c4c4 (diff) | |
download | gdb-7ec49f9133feadc43acc49b1ee00674ecb9c1c15.zip gdb-7ec49f9133feadc43acc49b1ee00674ecb9c1c15.tar.gz gdb-7ec49f9133feadc43acc49b1ee00674ecb9c1c15.tar.bz2 |
* section.c (SEC_LINKER_MARK): Define.
* bfd-in2.h: Rebuild.
* aoutx.h (NAME(aout,final_link)): Mark sections included in the
link.
(aout_link_input_bfd): Don't link unmarked sections.
* cofflink.c (_bfd_coff_final_link): Mark sections included in the
link.
(_bfd_coff_link_input_bfd): Don't link unmarked sections.
* coff-ppc.c (ppc_bfd_coff_final_link): Mark sections included in
the link.
* elflink.h (elf_bfd_final_link): Mark sections included in the
link.
(elf_link_input_bfd): Don't link unmarked sections.
* xcofflink.c (_bfd_xcoff_bfd_final_link): Mark sections included
in the link.
(xcoff_link_input_bfd): Don't link unmarked sections.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r-- | bfd/xcofflink.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index acf134d..ddb9cad 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -3217,6 +3217,12 @@ _bfd_xcoff_bfd_final_link (abfd, info) sec = p->u.indirect.section; + /* Mark all sections which are to be included in the + link. This will normally be every section. We need + to do this so that we can identify any sections which + the linker has decided to not include. */ + sec->flags |= SEC_LINKER_MARK; + if (info->strip == strip_none || info->strip == strip_some) o->lineno_count += sec->lineno_count; @@ -4571,6 +4577,12 @@ xcoff_link_input_bfd (finfo, input_bfd) { bfd_byte *contents; + if ((o->flags & SEC_LINKER_MARK) == 0) + { + /* This section was omitted from the link. */ + continue; + } + if ((o->flags & SEC_HAS_CONTENTS) == 0 || o->_raw_size == 0 || (o->flags & SEC_IN_MEMORY) != 0) |