This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SHT_GROUP support, part 1


On Sun, Oct 07, 2001 at 12:09:07AM -0700, Ulrich Drepper wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
> 
> > gas/ChangeLog
> > 	* config/obj-elf.c: (obj_elf_change_section): Add "group" param.
> > 	Set elf_section_data group from it.  Warn if group name changed.
> > 	(obj_elf_parse_section_letters): Parse 'G' too.
> 
> From what I see you add all section with the 'G' attribute set to the
> group.

No, you can add more than one group.

>  If this is true it is not covering everything.  Section groups
> are really interesting if you can add many different groups in one
> object file.  Like having a separate group for every function with its
> debug info, data, ...  You have to have something more complex where
> 
> a) you can name which group a given section belongs to (my reading of the
>    spec, and memories when we discussed this before writing it down) is
>    that each section can belong to at most one section group

That's what the current patch does.  I thought about allowing sections
to belong to multiple groups and decided the added complexity wasn't
worth it.

> b) provide a way to define the signature symbol of each group
> and eventually
> c) provide a way to determine the section name for the section group
>    section (this name could be generated as well since the name is
>    completely irrelevant)

At the moment, the signature symbol is the same as the section name,
specified by the last string in a .section directive.  eg.

 .section alan,"axG",@progbits,married

 .section liz,"axG",@progbits,married

specifies two code sections belonging to group "married".  There will
be a (possibly undefined) symbol in the object named "married", and
the SHT_GROUP section name will also be "married".

I'm a little puzzled as to why a symbol is needed for the signature.
Surely, a string is all that's needed?  The other slightly puzzling
thing in the info you sent me some time ago, is why "The group section
must appear in the section table before any section it is referencing"

> Note also that I think it's getting time to not force all the sections
> to have different names.  All sections which contain function code
> should be named .text, all data section .data, etc.  Generating new
> names for each function section etc is just adding unnecessary
> complexity.

Hmm, that could have interesting consequences, ie. lots of unwanted extra
sections as eg. gcc swaps between .rodata and .text during code generation.
I think you'd need some way to say "change to the most recently used
section of a given name"

Alan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]