This is the mail archive of the libc-help@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: How to implement a kernel feature check in the crt* files?


> What you could do is set e_flags bit (in both object files and
> executables/shared libraries) and, additionally, when .note.ABI-tag
> section is added in the final link (well, just look for
> ELF_NOTE_GNU note with ELF_NOTE_ABI and version smaller than 2.6.32,
> adjust it to 2.6.32) in the linker.  Then you don't need to add
> any runtime code and it will work even with older kernels.
> It is ugly, but ELF_NOTE_ABI is well defined and avoiding very ugly runtime
> code is desirable.

I wonder if we could come up with a generalized linker feature to support
this.  I'm thinking of something like having crt1.o contain two same-named
COMDAT groups with some magic marker that tells ld to select which one to
keep based on the e_flags mask.


Thanks,
Roland


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