This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/21050] New: Prevent tailcall optimizations
- From: "tetra2005 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 14 Jan 2017 06:33:40 +0000
- Subject: [Bug dynamic-link/21050] New: Prevent tailcall optimizations
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21050
Bug ID: 21050
Summary: Prevent tailcall optimizations
Product: glibc
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: dynamic-link
Assignee: unassigned at sourceware dot org
Reporter: tetra2005 at gmail dot com
Target Milestone: ---
Some libdl functions rely on return address to figure out the calling DSO and
then use this information in computation (e.g. output of dlsym depends on which
library called it).
As reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66826 this may
break under tailcall optimization i.e. in cases like
return dlsym(...);
Rich Felker suggested that adding new GCC attribute is a possible solution.
Another option would be to hack around dlsym to prevent tailcall from happening
e.g.
#define dlsym(h, name) { volatile void *sym = dlsym(h, name); return (void
*)sym; }
Which solution is more appropriate for Glibc?
--
You are receiving this mail because:
You are on the CC list for the bug.