bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gags on -pie executables


From: Ilya N. Golubev
Subject: gags on -pie executables
Date: Wed, 13 Sep 2006 04:35:17 +0400

Version: 6.5

System: x86_64-unknown-linux-gnu fedora core 4

Compiler: gcc-4.0.0-8

gdb can not handle one sort of binary executables that are otherwise
ran normally by the system.  They are those linked with `-pie' passed
to linking `cc'.  They may also be detected by `file' reporting
executable to be

ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

(Otherwise, it reports them as)

ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, 
dynamically linked (uses shared libs), not stripped

Otherwise they are regular executables, having `main' and `_start'
symbols, and having entry point at `_start'.  System runs program
built this way normally.  Program may be built with debugging
information (`-g'), and later assuming that.

`at' gdb command completes normally, but `bt' does not show line
numbers.  Even `i sh' shows no shared libraries, though `ldd' shows
that there should be some.  `b' with line numbers completes normally,
and then `c' outputs:

Continuing.
Warning:
Cannot insert breakpoint 2.
Error accessing memory address 0x6f66e: Input/output error.

All of these commands break the same way even if using `r' instead of
`at'.

Once the program is relinked without `-pie', even from the same object
files, gdb works normally.


Such an executables are actually part of some systems.  They are
abundant in one installed from
<http://download.fedoraproject.org/pub/fedora/linux/core/4/x86_64/>,
(see
<http://fedoraproject.org/wiki/Distribution/Download#head-e82afb53c564fe4d3c977246c5760fad2edfccd9>
for other ways to download).  This includes, but not limited to,
`/usr/bin/at', `/usr/bin/dig', `/usr/bin/host', `/usr/bin/omshell',
`/usr/bin/svn'.  (Hope that this is enough.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]