This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC,GAS]Propose to emit the attribute section after relaxation
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Terry Guo <flameroc at gmail dot com>, binutils at sourceware dot org
- Date: Thu, 18 Sep 2014 18:54:46 +0100
- Subject: Re: [RFC,GAS]Propose to emit the attribute section after relaxation
- Authentication-results: sourceware.org; auth=none
- References: <000001cfd26f$ce034f80$6a09ee80$ at arm dot com> <20140918081541 dot GA3770 at bubble dot grove dot modra dot org> <CAGbRaL5j1pnar_jaMig0OhydBbAhzqcdLkLyqJnACyTBPg-fNQ at mail dot gmail dot com> <20140918144959 dot GB3770 at bubble dot grove dot modra dot org>
On 18/09/14 15:49, Alan Modra wrote:
> On Thu, Sep 18, 2014 at 04:42:45PM +0800, Terry Guo wrote:
>> On Thu, Sep 18, 2014 at 4:15 PM, Alan Modra <amodra@gmail.com> wrote:
>>> That sounds reasonable. What you've done in the patch though is put
>>> the create_obj_attrs_section call later than relax_seg, after
>>> size_seg. Is there a reason you can't call create_obj_attrs_section
>>> immediately after the relax_seg loop?
>>
>> There are two reasons for this. [snip]
>
> The only real reason to put create_obj_attrs_section immediately after
> the relax_seg loop is if at some stage someone wants to put symbols in
> the obj_attrs section and then refer to them in expressions from
> another section. For example, someone might want obj_attr_start and
> obj_attr_end symbols, and use them to put the size of the obj_attr
> section into a data word. Doing that sort of thing would mean
> integrating create_obj_attrs_section into the relax_seg loop, a task
> made a little easier if create_obj_attrs_section was just after the
> loop. I think that is unlikely, so the patch is OK as is.
>
I don't think attributes are ever put in a SHF_ALLOC section, so I doubt
symbols referencing it would be useful; at least, not from other
SHF_ALLOC sections.
R.