This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: Allow section groups to be resolved as part of a relocatable link
- From: Alan Modra <amodra at gmail dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 10 May 2017 12:15:31 +0930
- Subject: Re: [PATCH] ld: Allow section groups to be resolved as part of a relocatable link
- Authentication-results: sourceware.org; auth=none
- References: <1490368289-27049-1-git-send-email-andrew.burgess@embecosm.com> <20170404100120.GE16711@bubble.grove.modra.org> <20170413220713.GH28064@embecosm.com> <20170509172942.GR16262@embecosm.com>
On Tue, May 09, 2017 at 06:29:42PM +0100, Andrew Burgess wrote:
> Any followup to the below?
Sorry, I put this aside as being a little difficult, and it
disappeared among too many other emails.
> * Andrew Burgess <andrew.burgess@embecosm.com> [2017-04-13 23:07:13 +0100]:
>
> > * Alan Modra <amodra@gmail.com> [2017-04-04 19:31:21 +0930]:
> >
> > > On Fri, Mar 24, 2017 at 03:11:29PM +0000, Andrew Burgess wrote:
> > > > This commit adds a new linker feature: the ability to resolve section
> > > > groups as part of a relocatable link.
> > >
> > > What happens with dwarf debug or .eh_frame info for discarded
> > > sections?
> >
> > Alan,
> >
> > Thanks for the feedback, sorry for the slow reply.
> >
> > I wasn't totally sure what you're asking for, as far as I'm aware
> > debug and eh_frame sections will work largely as before. However,
> > given your question I suspect you've spotted something that I'm still
> > not getting.
One of the "little difficulties" is admitting that when I wrote the
email, I was thinking that ld -r kept all the groups. ;-) It doesn't,
so the change isn't as major as I was thinking.
> +@item --inhibit-group-allocation
> +This option prevents the linker from resolving sections groups,
> +sections that are part of a group remain group members in the output
> +file and the section groups are retained. This is the default
> +behaviour for a relocatable link (@samp{-r}) but this option can be
> +used to change the behaviour of a final link. The script command
> +@code{INHIBIT_GROUP_ALLOCATION} has the same
> +effect. @xref{Miscellaneous Commands}.
This part is a problem. The ELF gABI says "Sections of type SHT_GROUP
may appear only in relocatable objects". Did you add the option for
symmetry? If so, let's drop this part.
--
Alan Modra
Australia Development Lab, IBM