On Sun, 26 Apr 2020 21:01:45 +0200
Philipp Klaus Krause <p...@spth.de> wrote:

> Assuming I have a space_a segemnt that I want placed directly behind the
> DATA segment, i sthere a way to do so from C code (i.e. without using
> linker options or linker scripts)?

With a custom crt0 you can do it, but you need to go to the asm level.
The linker sticks the segments together in the order they are first
mentioned - except when it doesn't: _CODE is a bit weird.

My Fuzix crt0 files start with stuff like

                ; Ordering of segments for the linker.
                ; WRS: Note we list all our segments here, even though
                ; we don't use them all, because their ordering is set
                ; when they are first seen.     
                .area _CODE
                .area _CODE2
                .area _VIDEO
                .area _CONST
                .area _INITIALIZED
                .area _DATA
                .area _BSEG
                .area _BSS
                .area _HEAP

etc, to force the order I want. The default crt0 does the same trick in
order to get GSINIT/GSFINAL right.

Alan


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to