[PATCH] D19272: [ELF] - linkerscript AT keyword (in output section description) implemented.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 21 04:11:44 PDT 2016
grimar added inline comments.
================
Comment at: ELF/LinkerScript.cpp:250
@@ -249,1 +249,3 @@
+uint64_t LinkerScript::getLma(uint64_t VA, StringRef SectionName) {
+ auto I = LmaExpr.find(SectionName);
----------------
ruiu wrote:
> Can you name this getLoadAddr and add comments what the load address is?
Done.
================
Comment at: ELF/Writer.cpp:1467-1470
@@ -1466,3 +1466,6 @@
- // If flags changed then we want new load segment.
+ bool HasLma = Script->hasLma(Sec->getName());
+ // If AT linker script command was used for section or if flags were
+ // changed, then we want new load segment.
uintX_t NewFlags = toPhdrFlags(Sec->getFlags());
+ if (HasLma || Flags != NewFlags) {
----------------
ruiu wrote:
> Then please explain why we need to do this instead of what we are doing here in the comment.
>
> // Segments are contiguous memory regions that has the same attributes
> // (e.g. executable or writable). There is one phdr for each segment. Therefore,
> // we need to create a new phdr when the next section has different flags or
> // is loaded at a discontiguous address using AT linker script command.
Done.
http://reviews.llvm.org/D19272
More information about the llvm-commits
mailing list