From: Ian Lance Taylor <ian@cygnus.com>
To: khan@xraylith.wisc.edu
Cc: gas2@cygnus.com
Subject: Re: i386-pe named linkonce section switching problem
Date: Sat, 05 Sep 1998 16:02:00 -0000 [thread overview]
Message-ID: <199809052302.TAA24819@subrogation.cygnus.com> (raw)
In-Reply-To: <9809021556.AA06709@modi.xraylith.wisc.edu>
Date: Wed, 02 Sep 1998 10:56:13 -0500
From: Mumit Khan <khan@xraylith.wisc.edu>
Platform : i386-pe (mingw32, cygwin32, etc)
binutils : everything upto and including 980830
compiler : egcs-1.1
The following C++ code shows an odd problem with switching named linkonce
sections within the same object file, and such code shows up in C++ with
jump tables. Essentially, we lose the linkonce directive after the switch.
The appended patch appears to fix this problems.
If I add a ``.linkonce discard'' to the second .section .text$func__Fc
when it switches back, the linkonce is preserved, but the final executable
crashes.
I doubt the patch would fix this problem.
Ian
Index: config/obj-coff.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/obj-coff.c,v
retrieving revision 1.155
diff -u -r1.155 obj-coff.c
--- obj-coff.c 1998/07/13 20:00:37 1.155
+++ obj-coff.c 1998/09/05 23:01:11
@@ -1214,6 +1214,12 @@
if (flags != SEC_NO_FLAGS)
{
+ flagword oldflags;
+
+ oldflags = bfd_get_section_flags (stdoutput, sec);
+ oldflags &= SEC_LINK_ONCE | SEC_LINK_DUPLICATES;
+ flags |= oldflags;
+
if (! bfd_set_section_flags (stdoutput, sec, flags))
as_warn (_("error setting flags for \"%s\": %s"),
bfd_section_name (stdoutput, sec),
next prev parent reply other threads:[~1998-09-05 16:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-09-02 8:56 Mumit Khan
1998-09-05 16:02 ` Ian Lance Taylor [this message]
1998-09-06 15:29 ` Mumit Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199809052302.TAA24819@subrogation.cygnus.com \
--to=ian@cygnus.com \
--cc=gas2@cygnus.com \
--cc=khan@xraylith.wisc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).