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: PATCH: Support DF_1_GLOBAL


On Wed, Nov 21, 2012 at 4:09 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Nov 21, 2012 at 1:00 PM, Carlos O'Donell
> <carlos@systemhalted.org> wrote:
>> On Wed, Nov 21, 2012 at 3:54 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>> Hi,
>>>
>>> This patch adds DF_1_GLOBAL support. Tested on x86-64, using linkers
>>> with and without -z global support.  OK to install?
>>>
>>> Thanks.
>>>
>>>
>>> H.J.
>>> ---
>>> 2012-11-21  H.J. Lu  <hongjiu.lu@intel.com>
>>>
>>>         * config.make.in (have-z-global): New variable.
>>>         * configure.in: Check if linker supports -z global.
>>>         * configure: Regenerated.
>>>         * elf/Makefile (tests): Add reldep10 if linker supports -z global.
>>>         (modules-names): Add reldepmod7.
>>>         (LDFLAGS-reldepmod7.so): New macro.
>>>         ($(objpfx)reldep10): New target.
>>>         ($(objpfx)reldep10.out): Likewise.
>>>         * elf/dl-open.c (dl_open_worker): Support DF_1_GLOBAL.
>>>         * elf/reldep10.c: New file.
>>>         * elf/reldepmod7.c: Likewise.
>>>         * include/elf.h (DT_1_SUPPORTED_MASK): Add DF_1_GLOBAL.
>>
>> The Solaris documention I've seen from Oracle says the value
>> of DF_1_GLOBAL is unused.
>>
>> What documentation defines the purpose of DF_1_GLOBAL?
>>
>> If DF_1_GLOBAL is documented somewhere, and we are following established
>> and compatible practice through the use of RTLD_GLOBAL, then I'm happy
>> to support the flag.
>>
>
> It is documented in elf/elf.h:
>
> #define DF_1_GLOBAL     0x00000002      /* Set RTLD_GLOBAL for this object.  */
>
> I don't have access to other OSes.

http://docs.oracle.com/cd/E26502_01/html/E26507/chapter6-42444.html

Scroll to "Table 13-10 ELF Dynamic Flags, DT_FLAGS_1" and notice it
says "DF_1_GLOBAL, 0x2, Unused."

Why would that be the case?

I believe that DF_1_GLOBAL == RTLD_GLOBAL is coming from the BSD's
since they appear to define it in that way. It would be nice to know
why this is ignored by Solaris... perhaps just not implemented.

Either way, given that BSD supports it as such is sufficient
motivation to provide portability in Linux by supporting it in glibc
using RTLD_GLOBAL.

I would like Roland to review this though.

Cheers,
Carlos.


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