hanchenye-llvm-project/lld/test/LinkerScript
Rafael Auler 347fb02093 [lld] Teach LLD how to parse most linker scripts
This patch does *not* implement any semantic actions, but it is a first step to
teach LLD how to read complete linker scripts. The additional linker scripts
statements whose parsing is now supported are:

* SEARCH_DIR directive
* SECTIONS directive
* Symbol definitions inside SECTIONS including PROVIDE and PROVIDE_HIDDEN
* C-like expressions used in many places in linker scripts
* Input to output sections mapping

The goal of this commit was guided towards completely parsing a default GNU ld
linker script and the linker script used to link the FreeBSD kernel. Thus, it
also adds a test case based on the default linker script used in GNU ld for
x86_64 ELF targets. I tested SPEC userland programs linked by GNU ld, using the
linker script dump'ed by this parser, and everything went fine. I then tested
linking the FreeBSD kernel with a dump'ed linker script, installed the new
kernel and booted it, everything went fine.

Directives that still need to be implemented:
* MEMORY
* PHDRS

Reviewers: silvas, shankarke and ruiu

http://reviews.llvm.org/D5852

llvm-svn: 221126
2014-11-03 04:09:51 +00:00
..
expr-precedence.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
incomplete-ternary.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
libname-err-1.test
libname-err-2.test
linker-script-outputformat.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
linker-script.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
missing-entry-symbol.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
missing-input-file-name.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
missing-input-sections.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
missing-operand.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
missing-output-section-name.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
missing-symbol.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00
sections.test [lld] Teach LLD how to parse most linker scripts 2014-11-03 04:09:51 +00:00