aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2003-06-18 00:30:04 +0000
committerH.J. Lu <hjl.tools@gmail.com>2003-06-18 00:30:04 +0000
commitf97b9cb853d19427d84a9a65716a9e049d4c480a (patch)
tree691907e4174af0bd735b4a70983de0134a37b5dc /ld/ldlang.c
parente6300d0dc65b17a4cc45fe044825885976eea5b9 (diff)
downloadgdb-f97b9cb853d19427d84a9a65716a9e049d4c480a.zip
gdb-f97b9cb853d19427d84a9a65716a9e049d4c480a.tar.gz
gdb-f97b9cb853d19427d84a9a65716a9e049d4c480a.tar.bz2
bfd/
2003-06-17 H.J. Lu <hongjiu.lu@intel.com> * section.c (struct sec): Put back kept_section. (STD_SECTION): Put back kept_section initialization. * bfd-in2.h: Regenerate. * elflink.h (elf_link_input_bfd): Also check discarded linkonce sections for relocateable output. Use kept_section to preserve debug information discarded by linkonce. ld/ 2003-06-17 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (section_already_linked): Put back assignment of kept_section.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index fccab0d..83d43b8 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1089,8 +1089,11 @@ section_already_linked (abfd, sec, data)
/* Set the output_section field so that lang_add_section
does not create a lang_input_section structure for this
- section. */
+ section. Since there might be a symbol in the section
+ being discarded, we must retain a pointer to the section
+ which we are really going to use. */
sec->output_section = bfd_abs_section_ptr;
+ sec->kept_section = l->sec;
if (flags & SEC_GROUP)
bfd_discard_group (abfd, sec);