[PATCH] Compile elf/rtld.c with -fno-tree-loop-distribute-patterns.

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Nov 26 13:36:00 GMT 2019



On 25/11/2019 19:28, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> Sigh... The dl_start_final_info struct is roughly 660 bytes (664 on powerpc
>> for instance, slight larger on mips). I wonder if we could just create a
>> static global on rtld.c to simplify it, since the stack usage won't be
>> released anyway.
> 
> I thought the stack is reset by the startup stub?

It is and also it seems we are stuck on using stack allocated for bootstrap_map
for some architectures. For instance, the powerpc32/fpic always generate a GOT 
access even for static variables (and some comments on rltd.c about it do not
grasp all architecture requirements).

> 
> At one point, we need to rewrite the bootstrap relocation in something
> else besides C, but I suppose we can just stick in
> -fno-tree-loop-distribute-patterns today.

Maybe with some reorganization and refactoring we can simplify the include 
hack done with dynamic-link.h while taking care of not generating the
required relocations (maybe a compiler flag could help us, at least to
warn when such relocation are being emitted?).  But I see your point where
we are using C to produce code that is a specific subset of language 
standard.

> 
>> Also, isn't the memset on !DONT_USE_BOOTSTRAP_MAP redundant?
> 
> Not sure if I understand the question.  The memset is likely redundant
> on Linux because the stack is fresh and unperturbed.  If the startup
> stub allocated it, clearing it wouldn't be necessary.  But the
> situation is a bit iffy at the C level.
> 

Never mind, my confusion here.



More information about the Libc-alpha mailing list