+2005-04-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * linker.c (_bfd_generic_link_output_symbols): Also check if
+ the output section of an input section has been removed from
+ the output file.
+
+ * section.c (bfd_section_list_remove): Clear the next field
+ of the removed section.
+ (bfd_section_removed_from_list): New.
+ * bfd-in2.h: Regenerated.
+
2005-04-11 David S. Miller <davem@davemloft.net>
* elf32-sparc.c (elf32_sparc_relocate_section,
*_ps = _s->next; \
if (_s->next == NULL) \
(ABFD)->section_tail = _ps; \
+ else \
+ _s->next = NULL; \
} \
while (0)
#define bfd_section_list_insert(ABFD, PS, S) \
(ABFD)->section_tail = &_s->next; \
} \
while (0)
+#define bfd_section_removed_from_list(ABFD, S) \
+ ((S)->next == NULL && &(S)->next != (ABFD)->section_tail)
void bfd_section_list_clear (bfd *);
abort ();
/* If this symbol is in a section which is not being included
- in the output file, then we don't want to output the symbol.
-
- Gross. .bss and similar sections won't have the linker_mark
- field set. */
- if ((sym->section->flags & SEC_HAS_CONTENTS) != 0
- && ! sym->section->linker_mark)
+ in the output file, then we don't want to output the
+ symbol. .bss and similar sections won't have the linker_mark
+ field set. We also check if its output section has been
+ removed from the output file. */
+ if (((sym->section->flags & SEC_HAS_CONTENTS) != 0
+ && ! sym->section->linker_mark)
+ || bfd_section_removed_from_list (output_bfd,
+ sym->section->output_section))
output = FALSE;
if (output)
. *_ps = _s->next; \
. if (_s->next == NULL) \
. (ABFD)->section_tail = _ps; \
+. else \
+. _s->next = NULL; \
. } \
. while (0)
.#define bfd_section_list_insert(ABFD, PS, S) \
. (ABFD)->section_tail = &_s->next; \
. } \
. while (0)
+.#define bfd_section_removed_from_list(ABFD, S) \
+. ((S)->next == NULL && &(S)->next != (ABFD)->section_tail)
.
*/