Bug 114073 - ld error "atexit" using dmalloc
ld error "atexit" using dmalloc
Product: Fedora
Classification: Fedora
Component: dmalloc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2004-01-22 05:40 EST by Gene Czarcinski
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-19 10:22:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gene Czarcinski 2004-01-22 05:40:50 EST
Description of problem:

I am posting this against glibc because dmalloc works fine on FC1 i386
and does not appear to be doing anything wrong.  This error occurs
both with dmalloc-4.8.1 in FC1 as well as the current dmalloc-5.2.4.

Attempting to compile link a simple program which include dmalloc.h I get:

gcc -O2 -g -fPIC -o mmaptest test2.c -ldmalloc
/usr/bin/ld: mmaptest: hidden symbol `atexit' in
/usr/lib64/libc_nonshared.a(atexit.oS) is referenced by DSO
collect2: ld returned 1 exit status
Comment 1 Gene Czarcinski 2004-01-22 07:37:15 EST
BTW, if you fiddle with the source and change dmalloc touse
on_exit(...) rather than atexit(...), it works.  However, atexit
should be OK too and it is not.
Comment 2 Jakub Jelinek 2004-01-22 07:40:56 EST
glibc is innocent.
libdmalloc.so has been built incorrectly (ld -shared instead of
gcc -shared).
Comment 3 Gene Czarcinski 2004-01-22 08:21:11 EST
OK ... but why does it work as is on i386 and not on x86_64?

Is this change documented somewhere?
Comment 4 Jakub Jelinek 2004-01-22 08:32:07 EST
If it works on any arch, it is by pure luck, nothing else.
ld -shared should never be used unless the developer is aware of
all consequences of it.
Comment 5 Gene Czarcinski 2004-01-22 12:56:10 EST
BTW, I am passing this info upstream to the dmalloc
maintainer/developer so future version (hopefully) will have this fixed.
Comment 6 Jakub Jelinek 2004-10-19 10:22:41 EDT
Should be fixed in dmalloc-5.3.0-3.

Note You need to log in before you can comment on or make changes to this bug.