On 8 March 2018 at 20:30, Jiří Zárevúcky <zarevucky.j...@gmail.com> wrote: > On 8 March 2018 at 20:12, Jakub Jermář <ja...@jermar.eu> wrote: >> On 03/08/2018 07:53 PM, Jiří Zárevúcky wrote: >>> I'm noticing that there are quite a few conditional parts in ia32 >>> linker script. As you may know, I consider unnecessary conditional >>> compilation to be An Evil Thing, thus I have to ask: Is there actually >>> a technical reason why we can't have the same linker script for all >>> configurations? >> >> The loader must not be loaded at the same address as the application it >> is trying to load, hence there is a distinction between the loader and >> an ordinary application. Also, statically and dynamically loaded stuff >> is different, requires different headers and different sections. >> > > Loader aside, that doesn't really answer my question. > Statically and dynamically loaded stuff are slightly different, but > the linker handles most of that automatically. For example, the linker > scripts generated by GNU ld only differ in very minor things between > different flavors, they don't use PHDRS at all, and list all the > sections, regardless of the fact that position-dependent executable > will never contain most of them. As far as I can tell, there is no > reason why a single linker script can't cover all the cases (except > loader, naturally).
So, I did a bit of tinkering, and with a few small adjustments it seems to work fine without any conditions whatsoever. https://github.com/HelenOS/helenos/compare/master...le-jzr:ldscript -- jzr _______________________________________________ HelenOS-devel mailing list HelenOS-devel@lists.modry.cz http://lists.modry.cz/listinfo/helenos-devel