This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: undefined reference to __gxx_personality_v0
> When a variable is eliminated from the optimized code, and its value was
> a constant, we can spill the constant value to memory and adjust the
> dwarf code to keep the variable and properly describe its value.
That might be necessary with -gdwarf-3 -gstrict-dwarf. It shouldn't
be necessary with DWARF 4 and/or GNU extensions--and in simple cases
not even with strict DWARF 3. The variable can just have a
DW_AT_const_value attribute that is DW_FORM_addr with a reloc to the
symbol (I think that is kosher strict DWARF 3). Or it can use a
location expression that uses DW_OP_addr <symbol> DW_OP_stack_value,
or even a a DW_OP_GNU_implicit_pointer if need be.
> There is the presumption that the constant is really referenced in the
> code, so we are not adding a new reference to a symbol. I'm a bit
> surprised that this is the only reference...
In this case, it's not actually in DWARF proper at all. It's just in
.eh_frame, for a .cfi_personality directive. (That much seems unsurprising
for this symbol--it would be more surprising if there were some reason for
__gxx_personality_v0 to appear in debug info.)
Thanks,
Roland