🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1233

gags on -pie executables

#1233
From: Ilya N. Golubev
Date: Wed, 13 Sep 2006 00:35
47 lines
3212 bytes
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.)
Technical Details
Message-ID: <mailman.7057.1158526396.9609.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,301771cb9349da5f,start
X-Google-Attributes: gidf5053,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: "Ilya N. Golubev" <gin@mo.msk.ru>
Newsgroups: gnu.gdb.bug
Subject: gags on -pie executables
Date: Wed, 13 Sep 2006 04:35:17 +0400
Lines: 49
Approved: bug-gdb@gnu.org
Message-ID: <mailman.7057.1158526396.9609.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1158526397 10392 199.232.76.165 (17 Sep 2006 20:53:17 GMT)
X-Complaints-To: news@news.stanford.edu
To: bug-gdb@gnu.org
Envelope-to: bug-gdb@gnu.org
X-Authentication-Warning: d-fens.mopniei.ru: gin set sender to gin@mo.msk.ru
 using -f
X-Mailman-Approved-At: Sun, 17 Sep 2006 16:53:15 -0400
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>