This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Should malloc-related functions be weak?


According to the __malloc_hook man page [1]

    Programmers should instead preempt calls to the relevant functions by
    defining and exporting functions such as "malloc" and "free".

But malloc, free and realloc are all global functions, causing problems when
linking statically.

Shouldn't they be weak functions?

For the record, we can close the following bugs after we answer this
question:
 - https://sourceware.org/bugzilla/show_bug.cgi?id=2765
 - https://sourceware.org/bugzilla/show_bug.cgi?id=16939

-- 
Tulio Magno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]