[PATCH] D22759: [ELF] Linkerscript: symbol assignments with indentifiers on the right side of expression.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 11:27:14 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:776-778
@@ -767,1 +775,5 @@
 
+uint64_t static getSymbolValue(StringRef S) {
+  return ScriptConfig->ExprBridge->getSymbolValue(S);
+}
+
----------------
ruiu wrote:
> Please do this.
> 
>   uint64_t static getSymbolValue(StringRef S) {
>     switch (Config->EKind) {
>     case ELF32LEKind:
>       if (SymbolBody *B = Symtab<ELF32LE>::X->find(S))
>         return B->getVA<ELF32LE>();
>       break;
>     case ELF32BEKind:
>       ...
>     case ELF64LEKind:
>       ...
>     case ELF64BEKind:
>       ...
>     }
>     error("symbol not found: " + S);
>     return 0;
>   }
> 
Done.

================
Comment at: ELF/LinkerScript.cpp:746
@@ -745,1 +745,3 @@
 
+uint64_t static getSymbolValue(StringRef S) {
+  switch (Config->EKind) {
----------------
ruiu wrote:
> `uint64_t static` -> `static uint64_t`.
Done.

================
Comment at: ELF/LinkerScript.cpp:764-765
@@ +763,4 @@
+    break;
+  default:
+    llvm_unreachable("unknown ELF kind");
+  }
----------------
ruiu wrote:
> We don't need this guard.
Removed.

================
Comment at: ELF/LinkerScript.cpp:851
@@ -825,3 +850,3 @@
 
   // Parse a number literal
   uint64_t V = 0;
----------------
ruiu wrote:
> Parse a symbol name or a number literal.
Fixed.


Repository:
  rL LLVM

https://reviews.llvm.org/D22759





More information about the llvm-commits mailing list