Debian Bug report logs - #421328
ld segfaults on global unmangled variables when using --print-map (Debian only)

version graph

Package: binutils; Maintainer for binutils is Matthias Klose <>; Source for binutils is src:binutils.

Reported by: Bas Wijnen <>

Date: Fri, 27 Apr 2007 22:00:01 UTC

Severity: normal

Found in version binutils/2.17cvs20070426-1

Fixed in version 2.18.1~cvs20071027-1

Done: Bas Wijnen <>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to,, James Troup <>:
Bug#421328; Package binutils. Full text and rfc822 format available.

Acknowledgement sent to Bas Wijnen <>:
New Bug report received and forwarded. Copy sent to, James Troup <>. Full text and rfc822 format available.

Message #5 received at (full text, mbox):

From: Bas Wijnen <>
To: Debian Bug Tracking System <>
Subject: ld segfaults on global unmangled variables when using --print-map (Debian only)
Date: Fri, 27 Apr 2007 23:58:48 +0200
Package: binutils
Version: 2.17cvs20070426-1
Severity: normal

When linking with the --print-map option, ld segfaults on unmangled
global variables.  In particular, the demangle function is called, which
returns NULL.  Then this is printed using puts, which results in the
segfault.  This only happens with the Debian version, when compiling
from the orig.tar.gz (from the Debian source package, but without the
diff.gz applied), the problem does not occur.

Example: having the source file foo.c, containing only one line:
int a;

The following will segfault:
gcc -Wl,--print-map foo.c

This will not segfault:
g++ -Wl,--print-map foo.c

On one machine, a self-compiled version also segfaults.  However, on an
other it doesn't.  It may be that it really is an upstream problem, and
I have somehow tested the wrong things.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages binutils depends on:
ii  libc6                         2.5-4      GNU C Library: Shared libraries

binutils recommends no packages.

-- no debconf information

Reply sent to Bas Wijnen <>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Bas Wijnen <>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #10 received at (full text, mbox):

From: Bas Wijnen <>
Subject: Can't reproduce anymore
Date: Mon, 17 Dec 2007 13:41:26 +0100
[Message part 1 (text/plain, inline)]
Version: 2.18.1~cvs20071027-1


This problem (ld segfaulting on globals when using --print-map) seems to
have been fixed, so I'll close the bug.


I encourage people to send encrypted e-mail (see
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see
[signature.asc (application/pgp-signature, inline)]

Bug archived. Request was from Debbugs Internal Request <> to (Tue, 15 Jan 2008 07:29:29 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.

Debian bug tracking system administrator <>. Last modified: Mon Apr 21 12:11:51 2014; Machine Name:

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.