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]
Other format: [Raw text]

Re: PATCH: IA64 unwind section references discarded section


On Mon, 2005-04-04 at 09:44, H. J. Lu wrote:
> > > > This is a linker patch. It creates a fake group section for a
> > > > linkonce text sections and its unwind sections. The fake group
> > > > section is removed before the output file is written.

I'm a little puzzled how you can reproduce this problem with icc.  You
indicated earlier that use of comdat would solve this problem. 
Presumably icc already uses comdat.  So how does icc run into the
problem?  If the problem is only with gcc, because gcc does not use
comdat by default yet, then the gas solution seems sufficient.  Maybe
this is the interaction of linking icc compiled code with gcc compiled
code?  If so, then maybe an assembler change to create group sections
would work, i.e. if the compiler didn't put text/unwind in a group, then
the assembler creates a group for them.  I suspect this would be much
easier than trying to fix the problem in the linker.  It does require
that the libraries get recompiled though.

This is a very unusual use of elf_backend_object_p.  Normally, it is
only used to set the appropriate mach.

There are warnings in elfcode.h in elf_object_p about bad things that
can happen if this hook is abused.  In particular, there is the issue
that this hook can be called multiple times for one object file, with
different target vectors.  If you are creating fake section groups every
time this hook is called, then you may end up with multiple fake section
groups that reference the same text/unwind sections.  Is that really
safe?  It doesn't seem like a good idea.

The use of shdr in elfNN_ia64_object_p is curious.  You have only one
fake section header.  For each fake section group you do this
        shdr.bfd_section = group;
        elf_section_data (group)->this_hdr = shdr;
That means you are repeatedly storing different data into the
bfd_section field, which doesn't seem right.  Maybe there is some
undocumented assumption here, such as relying on the fact that the group
is always inserted at the beginning?

There is a comment with bad punctation, you probably meant to use a
comma here:
    which isn't in a section group. and its unwind sections.  */
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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