[PATCH] D24830: [ELF] - Linkerscript: implemented BYTE/SHORT/QUAD commands.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 08:36:03 PDT 2016


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

Previously our scripts handles these commands incorrectly. For example:

```
SECTIONS  {
  .foo : {
 *(.foo.1)
 BYTE(0x11)
...
```
We accepted the script above treating BYTE as input section description. These commands are used in the wild though, eg:
https://searchcode.com/codesearch/view/42878166/

The BYTE, SHORT, LONG, and QUAD commands store one, two, four, and eight bytes (respectively). After storing the bytes, the location counter is incremented by the number of bytes
stored.

Patch implements them.


https://reviews.llvm.org/D24830

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  ELF/OutputSections.cpp
  test/ELF/linkerscript/data-commands.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24830.72178.patch
Type: text/x-patch
Size: 5901 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160922/6fc87c4e/attachment.bin>


More information about the llvm-commits mailing list