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]

Re: Backtrace_symbols and .symtab


On 10/22/2014 06:53 PM, Yury Gribov wrote:
Hi all,

Current backtrace_symbols(3) tries to read names of functions in call
stack from .dynsym which is usually very sparse compared to ordinary
symbol table in .symtab. Even if application is linked with -rdynamic
(which may be undesirable due to pollution of dynamic namespace, etc.),
.dynsym won't contain static functions, etc.

Has anyone considered making backtrace_symbols more .symtab-friendly
e.g. allowing users to prefer .symtab to .dynsym if it's available (*)?
This would of course be less (probably much less) efficient because
.symtab search would be linear (compared to hash table available for
.dynsym) but I can imagine usecases where this would be acceptable e.g.
printing friendly backtraces on error. AFAIK currently some projects
link against libunwind and elfutils for the sole purpose of getting
readable backtraces which should be available with glibc.

-Y

(*) ./elf/sprof.c already does something like this.


Cc-ed Andreas (though he has just announced that he won't work on glibc anymore...).

-Y


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