[PATCH] D27276: [ELF] Allow defined symbols to be assigned from linker script

Meador Inge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 19:55:36 PST 2017


meadori added inline comments.


================
Comment at: ELF/SymbolTable.h:63-68
+                     InputSectionBase<ELFT> *Section, InputFile *File,
+                     bool ForceReplace = false);
 
   Symbol *addSynthetic(StringRef N, const OutputSectionBase *Section,
-                       uintX_t Value, uint8_t StOther);
+                       uintX_t Value, uint8_t StOther,
+                       bool ForceReplace = false);
----------------
ruiu wrote:
> This is towards a right direction, but you don't need to modify the symbol table. The symbol table is to map names to symbols, but because you already have a symbol object in this case, symbol table lookups are not necessary. Please use replaceBody() to overwrite existing symbols with new ones.
Oh, I missed that you can get the `Symbol` object from the `SymbolBody` object.  I get it now.  Thanks.


https://reviews.llvm.org/D27276





More information about the llvm-commits mailing list