still invalid relocations generated for debug info (C++)
Ulrich Drepper
drepper@cygnus.com
Mon Oct 18 19:24:00 GMT 1999
I've reported this already on 10/7 but it's still not fixed. So I
looked a bit closer at the problem. The source code in question can
be downloaded at
http://www.cygnus.com/~drepper/nsTableFrame.ii.bz2
The problem is with the generation of debug information (stabs). At
some point the numbers for the labels generated in the code and those
used in the debug information diverge. This leads to expressions
where two symbols from different sections are substracted. Here are a
few excerpts:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi:
.LFB160:
.stabn 68,0,5524,.LM3914-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.LM3914:
pushl %ebp
[...]
.LBB1430:
.stabn 68,0,5534,.LM3918-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.LM3918:
cmpl $0, 88(%esi)
je .L5130
.LBB1431:
.stabn 68,0,5536,.LM3919-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.LM3919:
subl $4, %esp
leal -4(%ebp), %eax
pushl %eax
pushl %ebx
pushl 88(%esi)
.LCFI1047:
call SizeOf__C15ColumnInfoCacheP16nsISizeOfHandlerPUi
.stabn 68,0,5537,.LM3920-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.LM3920:
subl $4, %esp
movl (%ebx), %eax
pushl -4(%ebp)
pushl _13nsLayoutAtoms.tableColCache
pushl %ebx
movl 28(%eax), %eax
call *%eax
.LBE1431:
addl $32, %esp
.L5130:
.LBE1430:
.stabn 68,0,5542,.LM3921-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
[...]
.stabn 192,0,0,.LBB1430-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.stabn 192,0,0,.LBB1431-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.stabs "colCacheSize:(5,5)",128,0,5535,-4
.stabn 192,0,0,.LBB1432-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.stabn 224,0,0,.LBE1432-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.stabn 224,0,0,.LBE1431-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.stabn 224,0,0,.LBE1430-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
[...]
assign_with_QueryInterface__t8nsCOMPtr1Z11nsISupportsP11nsISupportsRC4nsIDPUi:
.LFB161:
.LBB1432:
.stabn 68,0,640,.LM3929-assign_with_QueryInterface__t8nsCOMPtr1Z11nsISupportsP11nsISupportsRC4nsIDPUi
[...]
.LM3936:
movl %ebx, (%edi)
.LBE1432:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Short summary:
- function SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi contains three
labelled blocks .LBB1429/.LBE1429, .LBB1430/.LBE1430, .LBB1431/.LBE1431
- function assign_with_QueryInterface__t8nsCOMPtr1Z11nsISupportsP11nsISupportsRC4nsIDPUi
contains among others block .LBB1432/.LBE1433
- the stabs generated for function
SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi correctly use the block
*1430 and *1431 but also use *1432
=> but *1432 is in the other function and therefore the lines
.stabn 192,0,0,.LBB1432-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
.stabn 224,0,0,.LBE1432-SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
cause problems.
I don't know whether it's important but the function
assign_with_QueryInterface__t8nsCOMPtr1Z11nsISupportsP11nsISupportsRC4nsIDPUi
is a template which gets instantiated at the end of the compilation and
SizeOf__C12nsTableFrameP16nsISizeOfHandlerPUi
is the last function in the file.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
More information about the Gcc-bugs
mailing list