aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-03-27 19:21:19 +0000
committerIan Lance Taylor <ian@airs.com>1996-03-27 19:21:19 +0000
commit7ec49f9133feadc43acc49b1ee00674ecb9c1c15 (patch)
tree15b0a0e3a31c92bfb1c22001426f2a84fb255ce3 /bfd/elflink.h
parentcf2e4f5fdee71e74fac6d295e642375db2e9c4c4 (diff)
downloadgdb-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/elflink.h')
-rw-r--r--bfd/elflink.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 4ef3c8b..d613d9d 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1798,6 +1798,12 @@ elf_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->relocateable)
o->reloc_count += sec->reloc_count;
@@ -2805,6 +2811,12 @@ elf_link_input_bfd (finfo, input_bfd)
/* Relocate the contents of each section. */
for (o = input_bfd->sections; o != NULL; o = o->next)
{
+ if ((o->flags & SEC_LINKER_MARK) == 0)
+ {
+ /* This section was omitted from the link. */
+ continue;
+ }
+
if ((o->flags & SEC_HAS_CONTENTS) == 0)
continue;