[PATCH] D24758: [ELF] - Linkerscript: support complex section pattern grammar.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 05:46:22 PDT 2016


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

Previously we were failed to parce complex expressions like:

```
foo : { *(SORT_BY_NAME(bar) zed) }
```

This is PR30442

Patch allows to handle them, for example the next grammar is parsed fine now:

```
.abc : { *(SORT(.foo.* EXCLUDE_FILE (*file1.o) .bar.*) .bar.*) }
```

Main idea of patch that globs and excludes can be wrapped in a SORT.
There is a difference in semanics of ld/gold:
ld likes:

```
*(SORT(EXCLUDE_FILE (*file1.o) .foo.1))
```
gold likes:

```
*(EXCLUDE_FILE (*file1.o) SORT(.foo.1))
```

I suggest to stick to ld grammar.

**Patch is depends and uses changes of D24685, so I`ll rebase it as soon
D24685 be landed.**

https://reviews.llvm.org/D24758

Files:
  ELF/LinkerScript.cpp
  ELF/LinkerScript.h
  test/ELF/linkerscript/sort2.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24758.71917.patch
Type: text/x-patch
Size: 10360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160920/e81ef82d/attachment.bin>


More information about the llvm-commits mailing list