On Fri, 2023-04-14 at 12:10 +0200, Nico Boehr wrote: > Quoting Nina Schoetterl-Glausch (2023-04-13 18:33:50) > [...] > > With a small linker script change the snippet could know it's own length. > > Then you could map just the required number of pages and don't need to keep those numbers in sync. > > Maybe it's because my knowledge about linker scripts is really limited or I > don't get it, but I fail to see the advantage of the additional complexity. > > My assumption would be that the number of pages mapped for the guest memory will > never really change. Keeping a define in sync seems more pragmatic than going > through linker script magic. I think just + . = ALIGN(4K); + esnippet = .; /* End data */ at the bottom of the snippet linker script would suffice. Then you could use esnippet as an extern symbol in the C code. But yeah, might not be worth it unless it would help with other snippets too.