aboutsummaryrefslogtreecommitdiff
path: root/ld/ldelf.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldelf.c')
-rw-r--r--ld/ldelf.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 9887e53..0499925 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -2188,14 +2188,21 @@ ldelf_before_place_orphans (void)
been discarded. */
asection *linked_to_sec;
for (linked_to_sec = elf_linked_to_section (isec);
- linked_to_sec != NULL;
+ linked_to_sec != NULL && !linked_to_sec->linker_mark;
linked_to_sec = elf_linked_to_section (linked_to_sec))
- if (discarded_section (linked_to_sec))
- {
- isec->output_section = bfd_abs_section_ptr;
- isec->flags |= SEC_EXCLUDE;
- break;
- }
+ {
+ if (discarded_section (linked_to_sec))
+ {
+ isec->output_section = bfd_abs_section_ptr;
+ isec->flags |= SEC_EXCLUDE;
+ break;
+ }
+ linked_to_sec->linker_mark = 1;
+ }
+ for (linked_to_sec = elf_linked_to_section (isec);
+ linked_to_sec != NULL && linked_to_sec->linker_mark;
+ linked_to_sec = elf_linked_to_section (linked_to_sec))
+ linked_to_sec->linker_mark = 0;
}
}
}