This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Which .stabs to use? (please help)


With (at least) g++ 3.0, it happens that the same function
is emmitted more than once but with different sizes.  This
is a problem because that results in multiple .stabs line-
number entries (N_SLINE) for the same function that contradict
in address offsets.

For example, I did run into the fact that a function
"_ZNSsC1ERKSs" in section ".gnu.linkonce.t._ZNSsC1ERKSs"
was generated three times, one of which contained the
assembly code:

	...
	movl    %esi, -60(%ebp)
	jmp     .L560
	.p2align 4,,7
.L570:
	movl    %eax, -60(%ebp)
.L560:
	movl    -60(%ebp), %esi
	...

where the other two have at that point the code:

	...
	movl    %esi, -60(%ebp)
.L1636:
	movl    -60(%ebp), %esi
	...

(Note that there is never being jumped to .L570).

While the effect of these two pieces of code is the same,
the difference causes an offset in the following assembly
code.

The .stabs generated contents *also* are generated three
times however, and although the runtime linker removes two
of the functions, the .stabs section is not touched: the
debug info of three times the same function remains, but
with different address ranges for the lines that correspond
with the code after .L560 and .L1636 respectively.

I need to know which .stabs entry is corresponding with the
object code that is *actually* linked.

At the moment my program barfs with:

BFD     : N_FUN: address 52f30 : "_ZNSsC1ERKSs:F(0,21)".
BFD     : N_SOL: "/usr/local/gcc-3.0/include/g++-v3/bits/basic_string.tcc".
BFD     : N_SLINE: line 185 starts at offset 0.
BFD     : N_SLINE: line 187 starts at offset ff.
BFD     : Register range 52f30 - 5302f; /usr/local/gcc-3.0/include/g++-v3/bits/basic_string.tcc:185 : "_ZNSsC1ERKSs".
WARNING : Collision with previously added range 52f30 - 53024; /usr/local/gcc-3.0/include/g++-v3/bits/basic_string.tcc:185 : "_ZNSsC1ERKSs".

tst_bfd_shared: elf32.cc:503: void libcw::debug::elf32::object_file_ct::register_range(const libcw::debug::elf32::location_st&, const libcw::debug::elf32::range_st&):
    Assertion `(*p.first).first.size == range.size' failed.

Is there a logical way to know which .stabs (address range)
is the correct one?

Thanks!

-- 
Carlo Wood <carlo@alinoe.com>


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