On Sun, Nov 19, 2017 at 8:17 AM, H.J. Lu wrote: > >>> +'--enable-static-pie' >>> + Build static executables, including tests, as position independent >>> + executable (static PIE) which is similar to static executable, but >>> + can be loaded at any address without help from a dynamic linker. >>> + The resulting libc.a can be used with the GCC option, -static-pie, >>> + which is available with GCC 8 or above, to create static PIE. Only >>> + i686, x86-64 and x32 targets are verified to work. >> >> Drop the last sentence, it will be outdated soon. Fixed. >>> diff --git a/Makeconfig b/Makeconfig >> >> The reason for some of the changes are not obvious at all to me, and >> the ChangeLog doesn't give an explanation either. > > Can you list them so that I can address them? I added some comments to Makeconfig. Do they answer your questions? >>> new file mode 100644 >>> index 0000000000..aa9302602b >>> --- /dev/null >>> +++ b/elf/dl-reloc-static-pie.c >> >> Is there anything which inhibits compilation of this file ith the >> stack protector? I think this is necessary because >> _dl_relocate_static_pie is called so early. > > Good point. I will check. _dl_relocate_static_pie must be compiled without stack protector. Since dl-reloc-static-pie.c is in elf, it is compiled with -fno-stack-protector. >>> +extern struct link_map * _dl_get_dl_main_map (void) >>> + __attribute__ ((visibility ("hidden"))); >> >> This should go into a header file somewhere, so that the declaration >> can be checked against the definition. > > I will see what I can do. I moved it to sysdeps/generic/ldsodefs.h. Here is the updated patch. Any more comments? Thanks. -- H.J.