[PATCH] D19237: ELF: Add +, -, *, / and & to SECTIONS linker script command.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 14:04:12 PDT 2016


ruiu created this revision.
ruiu added a reviewer: grimar.
ruiu added a subscriber: llvm-commits.

This patch is based heavily on George Rimor's patch
http://reviews.llvm.org/D19221.

In the linker script, you can write expressions to compute addresses.
Currently we only support "+" operator. This adds a few more operators.

Since this patch adds * and /, we need to handle operator precedences
properly. I implemented that using the operator-precedence grammar.

http://reviews.llvm.org/D19237

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  test/ELF/linkerscript-locationcounter.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19237.54113.patch
Type: text/x-patch
Size: 10555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160418/5285a6b1/attachment.bin>


More information about the llvm-commits mailing list