c/1964: code generation bug with -gdwarf-2 and -fPIC on x86
crigler@hell-city.org
crigler@hell-city.org
Tue Feb 13 10:16:00 GMT 2001
>Number: 1964
>Category: c
>Synopsis: code generation bug with -gdwarf-2 and -fPIC on x86
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Tue Feb 13 10:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Ned T. Crigler
>Release: 2.97 20010211 (experimental)
>Organization:
>Environment:
System: Linux xavtug.hell-city.org 2.4.1-ac5 #1 Wed Feb 7 15:27:33 EST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --verbose --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --prefix=/usr/local/egcs --with-gcc-version-trigger=/usr/local/src/egcs/gcc/version.c --with-gnu-as --with-gnu-ld --with-system-zlib --enable-threads=posix --enable-languages=c++ --enable-shared --enable-libstdcxx-v3 --cache-file=../config.cache --with-dwarf2 --disable-nls : (reconfigured)
>Description:
The PIC return address code is not placed in the .text section when DWARF2
debugging is used.
>How-To-Repeat:
Using gcc -mcpu=i686 -gdwarf-2 -g -fPIC on:
void
foo()
{
}
int
main()
{
foo();
return 0;
}
produces:
.section .debug_aranges
.4byte 0x1c
.2byte 0x2
.4byte .Ldebug_info0
.byte 0x4
.byte 0x0
.2byte 0x0,0
.4byte .Ltext0
.4byte .Letext0-.Ltext0
.4byte 0x0
.4byte 0x0
.LPR0:
movl (%esp), %ebx
ret
.ident "GCC: (GNU) 2.97 20010212 (experimental)"
The .LPR0 code is placed in the .debug_aranges section, instead of the .text
section. Since debugging sections aren't loaded at runtime, the program
crashes.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list