From 7b9eea348fbba7b2fb103bf63e9e34973c1cddff Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 22 Jun 1999 21:13:24 +0000 Subject: [PATCH] * ldlang.c (section_already_linked): Only discard link once sections if we are building constructors. --- ld/ChangeLog | 5 +++++ ld/ldlang.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index 70572de0fd8..0c2bf7b0794 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +1999-06-23 Ian Lance Taylor + + * ldlang.c (section_already_linked): Only discard link once + sections if we are building constructors. + 1999-06-22 Nick Clifton * ld.texinfo (Location Counter): Describe behaviour of diff --git a/ld/ldlang.c b/ld/ldlang.c index 862e4e2dbbf..d4c431ce5db 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -890,6 +890,11 @@ section_already_linked (abfd, sec, data) return; } + /* If we aren't building constructors, don't discard link once + sections. Otherwise we can get confused when generating relocs. */ + if (! config.build_constructors) + return; + flags = bfd_get_section_flags (abfd, sec); if ((flags & SEC_LINK_ONCE) == 0) -- 2.30.2