This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/19711] 32-bit application linked with "-z now" causes GDB to fail stepping over/into lines (possibly because of R_386_GLOB_DAT)
- From: "palves at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 08 Aug 2016 16:22:13 +0000
- Subject: [Bug gdb/19711] 32-bit application linked with "-z now" causes GDB to fail stepping over/into lines (possibly because of R_386_GLOB_DAT)
- Auto-submitted: auto-generated
- References: <bug-19711-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19711
Pedro Alves <palves at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com
--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
FWIW, I tried this on Fedora 23 with gdb 7.10.1, 7.11.1, and current gdb
master, and all worked correctly here.
$ make
g++ -m32 -g -fPIC -c main.cpp -o main.o
g++ -m32 -g -fPIC -c shared.cpp -o shared.o
g++ -m32 -g --shared -Wl,--gc-sections,--warn-shared-textrel -Wl,--no-undefined
-o libshared.so -fPIC -Wl,-z,relro,-z,defs,--build-id shared.o -lc
-Wl,-no-whole-archive
g++ -m32 -g -o main main.o -z defs -z origin -z now
-Wl,--gc-sections,-rpath='RIGIN',--build-id,--warn-shared-textrel -fPIE -pie
-L. -lshared
[pedro@cascais][~/tmp/rel/rel]
$ readelf -r main
Relocation section '.rel.dyn' at offset 0x450 contains 9 entries:
Offset Info Type Sym.Value Sym. Name
00001e98 00000008 R_386_RELATIVE
00001e9c 00000008 R_386_RELATIVE
00001ea4 00000008 R_386_RELATIVE
00001ffc 00000008 R_386_RELATIVE
00001fe8 00000406 R_386_GLOB_DAT 00000000 __gmon_start__
00001fec 00000506 R_386_GLOB_DAT 00000000 _Jv_RegisterClasses
00001ff0 00000706 R_386_GLOB_DAT 00000000 _ITM_deregisterTMClone
00001ff4 00000806 R_386_GLOB_DAT 00000000 _ITM_registerTMCloneTa
00001ff8 00000b06 R_386_GLOB_DAT 00000000 __cxa_finalize
Relocation section '.rel.plt' at offset 0x498 contains 5 entries:
Offset Info Type Sym.Value Sym. Name
00001fd4 00000407 R_386_JUMP_SLOT 00000000 __gmon_start__
00001fd8 00000607 R_386_JUMP_SLOT 00000000 __libc_start_main
00001fdc 00000907 R_386_JUMP_SLOT 00000000 printf
00001fe0 00000a07 R_386_JUMP_SLOT 00000000 _Z12do_somethingi
00001fe4 00000b07 R_386_JUMP_SLOT 00000000 __cxa_finalize
(gdb) start
Temporary breakpoint 1 at 0x6df: file main.cpp, line 8.
Starting program: /home/pedro/tmp/rel/rel/main
Temporary breakpoint 1, main (argc=1, argv=0xffffcb04) at main.cpp:8
8 int x = do_something(argc);
(gdb) n
9 x = do_something(x);
(gdb)
10 printf("All done: %d\n", x);
(gdb)
All done: 4
11 return x;
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.