This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix -fsection-anchors on Darwin
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Apr 2010 16:06:31 -0400
- Subject: Re: Fix -fsection-anchors on Darwin
- References: <5B4E06FE-CD05-49DF-A287-8E79240CDDCB@apple.com> <503321DF-8090-42EE-BD3D-64B5A489D2E5@apple.com> <20100414154709.GA6027@bromo.med.uc.edu> <9243C53D-4512-4BAD-9A1B-CC15DCC0973E@comcast.net>
On Mon, Apr 26, 2010 at 02:22:11PM -0700, Mike Stump wrote:
> On Apr 14, 2010, at 8:47 AM, Jack Howarth wrote:
> > Could you update your comments on this? Since it seems unlikely
> > that the linker will ever been changed on darwin to support section-anchors,
> > it seems to leave on the turning off subsections_via_symbols if we
> > wanted to implement section-anchors support on darwin, no?
>
> I don't believe they have changed any, nor has the linker, that leaves just changing the compiler to manage subsections_via_symbols appropriately.
>
> >> If the optimizer wants to jam all the data together into one object
> >> itself, and then write out that object, that would work as well, and
> >> there is something appealing about that. Also, to get nice codegen and
> >> dead code stripping, I think we want LTO to manage this issue.
> >
> > Since it appears that Mach-O LTO will be possible, I assume this can
> > be handled through that option.
Mike,
Do you think that Steven will be running into any issues with
subsections_via_symbols while implementing the Mach-O LTO support
or can this likely be put off until later? I ask because he thinks
we could be running into linker bugs.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43729#c15
Jack
>
> I'm not an LTO expert, so I can't comment on it, though, if I randomly guessed, yes, it probably could.
>
> On Apr 14, 2010, at 9:00 AM, Jack Howarth wrote:
> >
> > This openradar seems to discuss disabling subsections_via_symbols in the
> > assembly file but doesn't indicate how to do it from within the compiler...
> >
> > http://openradar.appspot.com/7201596
>
> You say:
>
> int do_subsections;
>
> if (do_subsection)
> printf(". subsections_via_symbols\n");
>
> and then set do_subsections appropriately (when flag_section_anchors is on). See darwin.c for the one line that needs to be changed.
>
> With that off, the linker should not reorder and slice and dice, or at least, that's the theory.