[PATCH] D19190: [ELF] - Implemented PROVIDE linker script command.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 16 09:44:28 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.

Patch implements PROVIDE command. It is often used in scripts I saw.

Description of PROVIDE (taken from https://www.sourceware.org/binutils/docs-2.10/ld_3.html#SEC17):
In some cases, it is desirable for a linker script to define a symbol only if it is referenced and is not defined by any object included in the link. For example, traditional linkers defined the symbol `etext'. However, ANSI C requires that the user be able to use `etext' as a function name without encountering an error. The PROVIDE keyword may be used to define a symbol, such as `etext', only if it is referenced but not defined. The syntax is PROVIDE(symbol = expression).


http://reviews.llvm.org/D19190

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/Symbols.h
  ELF/Writer.cpp
  test/ELF/linkerscript-provide.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19190.53990.patch
Type: text/x-patch
Size: 8060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160416/cee10fce/attachment.bin>


More information about the llvm-commits mailing list