`defined in discarded section' errors when building ia64 gcc
Jakub Jelinek
jakub@redhat.com
Tue Aug 17 11:19:00 GMT 2004
Hi!
Current gcc 3.4.x (at least gcc-3_4-rhl-branch) doesn't build with CVS
binutils (nor 2.15.91.0.2).
The problem is that libstdc++.so linking fails with:
`.gnu.linkonce.t._ZNSdD2Ev' referenced in section `.gnu.linkonce.ia64unw._ZNSdD2Ev' of .libs/sstream-inst.o: defined in discarded section `.gnu.linkonce.t._ZNSdD2Ev' of .libs/sstream-inst.o
The problem is that both io-inst.s and sstream-inst.s have
.gnu.linkonce.t._ZNSdD2Ev definition, but because io-inst.cc
also instantiates some templates sstream-inst.cc doesn't instantiate,
the inliner can do a better job in io-inst.cc.
The result is that _ZNSdD2Ev in io-inst.cc is a leaf routine, while
it is not in sstream-inst.cc (in assembly,
_ZNSdD2Ev in io-inst.s starts with .prologue and no .save directives,
while _ZNSdD2Ev] in sstream-inst.s has .prologue 12, 35 and some
.save directives.
IA-64 ABI allows leaf routines to have no unwind section at all,
which means .gnu.linkonce.ia64unw._ZNSdD2Ev is not created in
io-inst.o at all and as .gnu.linkonce.t._ZNSdD2Ev comes first
and wins, .gnu.linkonce.ia64unw._ZNSdD2Ev in sstream.o suddenly
references a discarded section.
Not sure what should be done here, but certainly the compiler
isn't at fault here, it is a binutils problem.
One fix could be to create empty .gnu.linkonce.ia64unw.* section
in assembler, another special case ia64 unwind sections in the linker.
What do you think?
Jakub
More information about the Binutils
mailing list