[PATCH] D32171: [ELF] - Implemented --defsym option #2

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 09:19:02 PDT 2017


grimar created this revision.

gnu ld description of option is:

--defsym=symbol=expression
Create a global symbol in the output file, containing the absolute address given by expression. You may use this option as many times as necessary to define multiple symbols in the command line. A limited form of arithmetic is supported for the expression in this context: you may give a hexadecimal constant or the name of an existing symbol, or use "+" and "-" to add or subtract hexadecimal constants or symbols. If you need more elaborate expressions, consider using the linker command language from a script. Note: there should be no white space between symbol, the equals sign ("="), and expression.

In compare with https://reviews.llvm.org/D32082, this patch does not support math expressions. It implemented via code similar to --wrap + code that creates absolute symbol.
That covers 2 of 3 possible --defsym cases.


https://reviews.llvm.org/D32171

Files:
  ELF/Driver.cpp
  ELF/Options.td
  ELF/SymbolTable.cpp
  ELF/SymbolTable.h
  test/ELF/defsym.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32171.95586.patch
Type: text/x-patch
Size: 4532 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170418/b9d95995/attachment.bin>


More information about the llvm-commits mailing list