|
From: | Howard Chu |
Subject: | Re: -dlopen self on AIX |
Date: | Sun, 30 Oct 2005 13:31:47 -0800 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051027 SeaMonkey/1.1a |
Albert Chin wrote:
On Sun, Oct 30, 2005 at 11:38:26AM -0800, Howard Chu wrote:Albert Chin wrote:Wait. The fact that -bexpall "doesn't export everything" is A Good Thing. Symbol tables on AIX include a lot of junk that other modules simply don't need to see. The symbols they omit are generally not useful for user code anyway.On Sun, Oct 30, 2005 at 11:14:14AM -0600, Albert Chin wrote:[snip ...] This means the method libtool uses to support -dlopen self on AIX won't work (by building a list of symbols into some xxS.o file and linking it with the executable). The real solution is to -bE the symbol list. What's the cleanest way to do this? Dynamic module support in openldap-2.3.x isn't working on AIX for the above reason. Using -bexpall or -bE when linking the main binary does work though. While the main binary, slapd, doesn't dlopen itself, modules it dlopen()'s cannot resolve symbols in slapd because they weren't exported.Seems the openldap folks should really use -export-dynamic, which isn't defined for AIX. We could make it -bexpall but as documented in the previous mail, it doesn't export everything. So, should we create a new variable, export_dynamic_cmds? If so, and temporary files are created by it, how do we clean up?It might be a "A Good Thing" in terms of being "pure", but it's different than the behavior on Solaris, HP-UX, Tru64 UNIX, IRIX, and Linux. It's just not worth it being that different today. AIX certainly has no advantage because of it.
Yes, it's a given that AIX is different from every other Unix in the world. But you have no idea what you're asking for here. If -bexpall actually exported every symbol, it would be utterly unusable. As someone who has been (suffering through) building dynamic modules on AIX since 3.2.0, I know what I'm talking about. The fact that the linker hides extraneous symbols today merely brings it inline with normal expectations / behavior on other platforms. You aren't missing anything with the symbols that aren't exported, none of them are user-level. E.g., in AIX, an exported function appears two or three times in the symbol table. Once for the actual body of the function, and a couple more times in the Data or BSS segments, as function pointers that are relocated in the calling modules address space. These extra symbols are only of importance to the dynamic loader, and it always knows how to find them. On older versions of AIX, that actually exported everything with -bexpall, you got duplicate symbols and clashes. The only usable way to link anything was using an explicit exports file. The current behavor of -bexpall is a significant improvement. It ain't broke, leave it alone.
-- -- Howard Chu Chief Architect, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc OpenLDAP Core Team http://www.openldap.org/project/
[Prev in Thread] | Current Thread | [Next in Thread] |