[PATCH] D50065: [LLD] Only increase LMARegion if different from MemRegion

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 23:35:24 PDT 2018


kschwarz added inline comments.


================
Comment at: test/ELF/linkerscript/at8.test:11
+SECTIONS {
+    .text : { *(.text) } > RAM AT> RAM
+    .sec : { *(.sec) } > RAM
----------------
ruiu wrote:
> This seems to be equivalent to `.text : { *(.text) } > RAM`. What is the point of appending `AT> RAM`?
If used together with the REGION_ALIAS feature, this becomes more clear.
Often, the MEMORY commands and SECTIONS commands are kept in different linker scripts and the REGION_ALIAS feature is used to keep them independent.
This way, we can use the same linker script containing the SECTIONS commands and just switch the linker script containing the MEMORY commands for different targets.
Then, one target might map RAM2 to some flash region, while the other target simply maps to the same ram region. 


https://reviews.llvm.org/D50065





More information about the llvm-commits mailing list