Page MenuHomeFreeBSD

linker: Recognize SHT_INIT_ARRAY sections as constructor sections
ClosedPublic

Authored by markj on Tue, Jul 14, 11:09 PM.
Tags
None
Referenced Files
F163361562: D58245.id182012.diff
Wed, Jul 22, 12:33 PM
F163361058: D58245.id182012.diff
Wed, Jul 22, 12:26 PM
Unknown Object (File)
Tue, Jul 21, 9:30 PM
Unknown Object (File)
Tue, Jul 21, 9:23 PM
Unknown Object (File)
Tue, Jul 21, 7:02 AM
Unknown Object (File)
Tue, Jul 21, 1:30 AM
Unknown Object (File)
Mon, Jul 20, 11:52 PM
Unknown Object (File)
Mon, Jul 20, 11:33 PM
Subscribers

Details

Summary

We do this already for ET_REL files, but it was missed here. Note that
this function operates only on dynamically loaded files, not on
preloaded files.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
sys/kern/link_elf.c
1311

In theory there could be both init and initarray

This revision is now accepted and ready to land.Wed, Jul 15, 1:35 PM
sys/kern/link_elf.c
1311

My motivation is really just to handle a specific case where .init_array is added by KASAN. We are not executing constructors for the kernel since for some reason we rely on the loader to pass them down in module metadata.