From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: hjl@zoom.com Cc: eric@aib.com, gas2@cygnus.com Subject: Re: -Bsymbolic is broken in ld Date: Mon, 29 Jan 1996 11:29:00 -0000 Message-id: <199601291929.OAA06380@sanguine.cygnus.com> References: <199601291632.IAA11943@aurora.romoidoy.com> X-SW-Source: 1996/msg00007.html From: H J Lu Date: Mon, 29 Jan 1996 08:32:24 -0800 (PST) I think -Bsymbolic in ld is broken. It doesn't work in most cases. I just checked in a patch which fixes the case I know of, namely the problem you sent me. Please let me know if there are any other problems. May I suggest one approach? 1. Remove all the old -Bsymbolic stuff, except for setting DT_SYMBOLIC. 2. Add the BSF_SYMBOLIC bit to the symbol flag in addition to BSF_GLOBAL, BSF_WEAK, BSF_LOCAL, ... 3. If the BSF_SYMBOLIC bit is set, the symbol is treated just like a local symbol. 3. When writing to the disk, clear the BSF_SYMBOLIC bit. Ian, Eric, will that work? I really like to see -Bsymbolic get fixed. This is more complex than the current approach. The trick is in step 3, in knowing when to treat the symbol as local and when to treat it as global. When you have determined that, it is just as easy to simply check whether the -Bsymbolic flag was specified as it is to see whether the BSF_SYMBOLIC flag was set for the symbol. Ian