Page MenuHomeFreeBSD

link_elf_obj: Process init_array and fini_array
ClosedPublic

Authored by markj on Mar 3 2021, 9:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 12 2024, 7:40 PM
Unknown Object (File)
Dec 9 2024, 12:49 AM
Unknown Object (File)
Dec 6 2024, 3:46 PM
Unknown Object (File)
Nov 13 2024, 1:52 PM
Unknown Object (File)
Nov 10 2024, 3:48 PM
Unknown Object (File)
Oct 12 2024, 3:33 PM
Unknown Object (File)
Oct 9 2024, 9:45 AM
Unknown Object (File)
Oct 9 2024, 7:04 AM
Subscribers

Details

Summary

Reuse the existing logic for .ctors/.dtors.

This is required for KASAN.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37553
Build 34442: arc lint + arc unit

Event Timeline

markj requested review of this revision.Mar 3 2021, 9:05 PM
markj added inline comments.
sys/kern/link_elf_obj.c
535

I am not sure why .dtors is not handled. I don't have a use for it but can implement it if it seems worthwhile.

In principle it could be that an object contains both .ctors and SHT_INIT_ARRAY sections. I suggest to warn, at least.

BTW, we rely on ld -r correctly merge all sections with the same name+attributes, but for many reasons this might not occur. So I think a warning is due if ctors_addr is non-NULL.

Print a warning if ctors_addr is already non-zero.

This revision is now accepted and ready to land.Mar 3 2021, 10:36 PM