If both the MemRegion and LMARegion are set for an output section in a linker script, we should only increase the LMARegion if it is different from the MemRegion. Otherwise, we reserve the memory twice.
Details
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
Overall looks good to me. Comments are below.
(I would rename the test from at8.s to at6.s though, since we do not have at6.s yet.)
test/ELF/linkerscript/at8.test | ||
---|---|---|
10 | We usually try to reduce the test cases. | |
17 | Please add a brief comment describing what are you checking in this test case. I would also add a header to show what is 0000000020000000 and 001000. | |
21 | I think this line does not make sense. All LOADs are always listed after the header: |
Address review comments.
This patch was split from https://reviews.llvm.org/D50052, which adds at6.test and at7.test
test/ELF/linkerscript/at8.test | ||
---|---|---|
12 | This seems to be equivalent to .text : { *(.text) } > RAM. What is the point of appending AT> RAM? |
test/ELF/linkerscript/at8.test | ||
---|---|---|
12 | If used together with the REGION_ALIAS feature, this becomes more clear. |
We usually try to reduce the test cases.
This alias seems to be excessive here, so I would remove.
Otherwise, it looks like having an alias is important, though it is not.