theseus-os / Theseus

Theseus is a modern OS written from scratch in Rust that explores 𝐢𝐧𝐭𝐫𝐚𝐥𝐢𝐧𝐠𝐮𝐚𝐥 𝐝𝐞𝐬𝐢𝐠𝐧: closing the semantic gap between compiler and hardware by maximally leveraging the power of language safety and affine types. Theseus aims to shift OS responsibilities like resource management into the compiler.
https://www.theseus-os.com/
MIT License
2.92k stars 172 forks source link

Fix section order on x86_64 when using older versions of `ld` #1038

Closed tsoutsman closed 1 year ago

tsoutsman commented 1 year ago

Older versions of ld place the .cls, .tdata, and .tbss sections first because they are used in linker script variable definitions. This creates problems because memory_x86_64 assumes a specific order of the sections. The fix is the same as for AArch64 --- move the definitions to the end of the file.