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: linkonce sections, DWARF2 EH, and the ppc failures


On Sun, 17 Jun 2001, Geoff Keating wrote:

> which is IMHO not an unreasonable thing to do.  The linker then
> combines all the linkonce sections, and decides to resolve this symbol
> to the start of the linkonce section in the _output_ file.

 That's an expected behaviour.

> Unfortunately, the two compiled procedures differ because the
> testsuite is compiled with -O0 and string-inst.o is compiled with -O2,
> so the unwinder loses its mind and aborts.

 While the actual code may differ, its semantics must be the same for all
procedures.  Otherwise the whole idea of linkonce sections makes no sense 
(and your C++ code will break).

> IMHO, the linker behaviour here is wrong.  The reloc refers to the
> start of the `.gnu.linkonce.t._ZNKSs2atEj' section in the input file.
> If that section is not going into the output file, the linker should
> behave as if that symbol was undefined.

 Wrong.  Linkonce sections are used for templates.  The idea is to keep a
single copy of code that gets included in a binary and might be invoked
from code linked in from different object modules.  I can't check exact
implementation details now -- I'm away and I don't have gcc sources handy. 
But check the "Template Instantiation" node in gcc's info pages for more
information. 

> Unfortunately, this doesn't solve my problem, because what I really
> want is to have the reloc resolved to (say) zero.

 I don't think this is right -- you want the reloc be resolved to the real
symbol, not any fake one.

> So, how about this?

 This seems wrong.  You should fix the DWARF2 unwinder, I suppose.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +



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