This is the mail archive of the 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] elf: Always set l in _dl_init_paths (Bug 23462).

On 10/25/19 4:36 AM, Florian Weimer wrote:
> * Carlos O'Donell:
>> This does not turn out to be true. And it makes sense when I think
>> about it more thoroughly.
>> The static executable, lacking a .dynamic section, does not fill in
>> any of the link maps's l_info data, in fact it's all just a list of
>> NULLs because there was no data to load.
> Statically linked executables can have dynamic segments.  However, there
> seems to be a bug in BFD ld because it ignores -rpath for them.

OK, so we assume you can assemble a minimum .dynamic in a static 
executable with a DT_RUNPATH or DT_RPATH that will impact a dlopen
made from a static executable?

Did you file a binutils bug for this?

>> You would have to assemble a static binary with a .dynamic section
>> and the static linker doesn't want to do that.
> You can use -static-pie on some targets, then there is a dynamic
> segment, and BFD ld adds DT_RPATH to it.

Oh! That's a great idea, let me add a test case conditioned on that
then, since we have all those pieces in place.


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