apache / mynewt-newt

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
117 stars 95 forks source link

newt: Generate link tables header #542

Closed m-gorecki closed 6 months ago

m-gorecki commented 7 months ago

Adding pkg.link_tables field with link tables names will result in generation of link_tables.ld.h file which will be used in auto-generated linker script.

andrzej-kaczmarek commented 6 months ago

how does this work if build contains more than 1 package using this feature?

m-gorecki commented 6 months ago

@andrzej-kaczmarek Entries from each pkg used in the build will be collected and placed in the generated header.

andrzej-kaczmarek commented 6 months ago

so I don't really understand what's the purpose of that if everything is put in single and thus can only be included in single section of linker script...

kasjer commented 6 months ago

@andrzej-kaczmarek It's put in one section (for cortex it's in .text just before .rodata) but it adds __<section>__start__ and __<section>__end__ that can be referred in code making link time tables