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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 10:30:30 PDT 2016


ruiu 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);
+}
+
----------------
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;
  }



https://reviews.llvm.org/D22759





More information about the llvm-commits mailing list