[PATCH] D42911: [ELF] - Make defsym to work correctly with reserved symbols.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 16:05:08 PST 2018


ruiu added inline comments.


================
Comment at: ELF/LinkerScript.cpp:74-78
   // If the alignment is trivial, we don't have to compute the full
   // value to know the offset. This allows this function to succeed in
   // cases where the output section is not yet known.
-  if (Alignment == 1)
+  // In case of output section we always want to compute the full value
+  // because use special offset value (-1) as end of section mark.
----------------
In general, when you change existing code, you should update the comment instead of adding sentences to existing comment so that the comment doesn't look patchy. Comments shouldn't reflect the history of code change but just describe why we are doing this.

So, this is just that if an expression is absolute and has no alignment requirement, its value is simply the output value, no?


https://reviews.llvm.org/D42911





More information about the llvm-commits mailing list