On 8 March 2018 at 20:12, Jakub Jermář <[email protected]> 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).

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to