Page MenuHomeFreeBSD

ld(1): Correctly define .init_array and .fini_array for all platforms.
Needs ReviewPublic

Authored by hselasky on Jun 7 2023, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 5, 5:41 AM
Unknown Object (File)
Sat, Apr 27, 9:16 AM
Unknown Object (File)
Mar 19 2024, 3:39 PM
Unknown Object (File)
Mar 19 2024, 3:10 PM
Unknown Object (File)
Dec 22 2023, 11:30 PM
Unknown Object (File)
Aug 14 2023, 5:47 PM
Unknown Object (File)
Aug 14 2023, 4:10 AM
Unknown Object (File)
Aug 2 2023, 6:44 PM

Details

Summary

The constructor and destructor section names can have a priority
suffixed, as a decimal number.

Unless the ldscript is instructed to sort these sections
into a single one, this feature does not work as expected.

MFC after: 1 week
Sponsored by: NVIDIA Networking

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

arichardson added a subscriber: arichardson.

This will sort by name not priority. Ld.lld will sort by priority automatically if you omit init_array from the linker script but for bfd you need SORT_BY_INIT_PRIORITY

This revision now requires changes to proceed.Jun 7 2023, 4:18 PM

@arichardson : Use SORT_BY_INIT_PRIORITY()

Should .ctors and .dtors use the same?