On Wed, 29 Mar 2023 at 02:34, Philipp Klaus Krause <p...@spth.de> wrote:
> Am 28.03.23 um 21:55 schrieb Adrian Chadd: > > > If I were doing this with gcc/gnu linker, I'd just define a symbol at > > the end of the generated segments in RAM. but the segment/area list here > > is .. not defined the same way. And it seems that the linker logic is a > > little different per target platform because, well, embedded > > microprocessor/controllers can have funky addressing/banking > > requirements. :) > > The linker does give you the start and length for each segment (see the > beginning of the map file for examples, e.g. for a segment ADATA, the > linker creates symbols s_ADATA and l_ADATA). Then you can calculate the > end from them. > > That bits easy, yup! But the trick is actually /knowing/ which area is the last one. The thing that was tripping me up was that the sdcc-cpm examples use a cpm0.s replacement for crt0.s that didn't define all the areas early on, so some of them were showing up after my "last" one (notably HEAP / HEAP_END.) -adrian
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user