Summary: | malloc.c strong_alias for free, malloc, realloc should be weak_alias | ||
---|---|---|---|
Product: | glibc | Reporter: | Mike Bland <mbland> |
Component: | malloc | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | dank, geir, glibc-bugs, ian, mec, neleai |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.3.5 | ||
Target Milestone: | --- | ||
Host: | i686-pc-linux-gnu | Target: | i486-linux-gnu |
Build: | i486-linux-gnu | Last reconfirmed: |
Description
Mike Bland
2006-06-14 07:52:42 UTC
No. You cannot replace just parts of the implementation. But what about the use case of hooking malloc? That requires the requested behavior, and yet it is not replacing part of the implementation. This behavior prevents the TotalView memory debugging feature from working with statically link codes: $ cat main.c int main() { } $ gcc -static -g -L/opt/toolworks/totalview.8.6.0/linux-x86-64/lib -ltvheap_cnl_static -lpthread main.c /usr/lib/../lib64/libc.a(malloc.o): In function `free': (.text+0x1c90): multiple definition of `free' /opt/toolworks/totalview.8.6.0/linux-x86-64/lib/libtvheap_cnl_static.a:(.text+0x60d5): first defined here /usr/lib/../lib64/libc.a(malloc.o): In function `malloc': (.text+0x3fe0): multiple definition of `malloc' /opt/toolworks/totalview.8.6.0/linux-x86-64/lib/libtvheap_cnl_static.a:(.text+0x60e3): first defined here /usr/lib/../lib64/libc.a(malloc.o): In function `realloc': (.text+0x4470): multiple definition of `realloc' /opt/toolworks/totalview.8.6.0/linux-x86-64/lib/libtvheap_cnl_static.a:(.text+0x610d): first defined here collect2: ld returned 1 exit status $ Any insight why is strong alias in malloc et. al. needed? |