Bug 114073 - ld error "atexit" using dmalloc
Summary: ld error "atexit" using dmalloc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dmalloc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-22 10:40 UTC by Gene Czarcinski
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-19 14:22:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Gene Czarcinski 2004-01-22 10:40:50 UTC
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 12:37:15 UTC
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 12:40:56 UTC
glibc is innocent.
libdmalloc.so has been built incorrectly (ld -shared instead of
gcc -shared).

Comment 3 Gene Czarcinski 2004-01-22 13:21:11 UTC
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 13:32:07 UTC
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 17:56:10 UTC
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 14:22:41 UTC
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.