2014-01-27 11:09:26 +08:00
|
|
|
# This tests the basic functionality of ordering data and functions as they
|
2013-05-11 00:44:02 +08:00
|
|
|
# appear in the inputs
|
2013-09-23 12:24:15 +08:00
|
|
|
RUN: lld -flavor gnu -target i386 -e global_func --noinhibit-exec --output-filetype=yaml \
|
2014-01-27 11:09:26 +08:00
|
|
|
RUN: %p/Inputs/object-test.elf-i386 -o %t
|
2013-04-05 04:34:37 +08:00
|
|
|
RUN: FileCheck %s -check-prefix ELF-i386 < %t
|
2013-09-23 12:24:15 +08:00
|
|
|
RUN: lld -flavor gnu -target hexagon -e global_func --noinhibit-exec --output-filetype=yaml \
|
2014-01-27 11:09:26 +08:00
|
|
|
RUN: %p/Inputs/object-test.elf-hexagon -o %t1
|
2013-09-12 23:43:09 +08:00
|
|
|
RUN: FileCheck %s -check-prefix ELF-hexagon < %t1
|
|
|
|
|
2014-01-27 11:09:26 +08:00
|
|
|
ELF-i386: defined-atoms:
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-i386: - name: global_func
|
|
|
|
ELF-i386: - name: static_func
|
|
|
|
ELF-i386: - name: weak_func
|
|
|
|
ELF-i386: - name: hidden_func
|
|
|
|
ELF-i386: - name: no_dead_strip
|
|
|
|
ELF-i386: - name: no_special_section_func
|
ELF: Don't use LayoutPass.
Previously we applied the LayoutPass to order atoms and then
apply elf::ArrayOrderPass to sort them again. The first pass is
basically supposed to sort atoms in the normal fashion (which
is to sort symbols in the same order as the input files).
The second pass sorts atoms in {init,fini}_array.<priority> by
priority.
The problem is that the LayoutPass is overkill. It analyzes
references between atoms to make a decision how to sort them.
It's slow, hard to understand, and above all, it doesn't seem
that we need its feature for ELF in the first place.
This patch remove the LayoutPass from ELF pass list. Now all
reordering is done in elf::OrderPass. That pass sorts atoms by
{init,fini}_array, and if they are not in the special section,
they are ordered as the same order as they appear in the command
line. The new code is far easier to understand, faster, and
still able to create valid executables.
Unlike the previous layout pass, elf::OrderPass doesn't count
any attributes of an atom (e.g. permissions) except its
position. It's OK because the writer takes care of them if we
have to.
This patch changes the order of final output, although that's
benign. Tests are updated.
http://reviews.llvm.org/D7278
llvm-svn: 227666
2015-01-31 10:05:01 +08:00
|
|
|
ELF-i386: - name: global_variable
|
|
|
|
ELF-i386: - name: uninitialized_static_variable
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-i386: - name: special_section_func
|
2014-01-27 11:09:26 +08:00
|
|
|
ELF-i386: undefined-atoms:
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-i386: - name: puts
|
2014-01-27 11:09:26 +08:00
|
|
|
ELF-i386: absolute-atoms:
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-i386: - name: sample.c
|
|
|
|
|
|
|
|
ELF-hexagon: - name: global_func
|
|
|
|
ELF-hexagon: - name: static_func
|
|
|
|
ELF-hexagon: - name: weak_func
|
|
|
|
ELF-hexagon: - name: hidden_func
|
|
|
|
ELF-hexagon: - name: no_dead_strip
|
|
|
|
ELF-hexagon: - name: no_special_section_func
|
ELF: Don't use LayoutPass.
Previously we applied the LayoutPass to order atoms and then
apply elf::ArrayOrderPass to sort them again. The first pass is
basically supposed to sort atoms in the normal fashion (which
is to sort symbols in the same order as the input files).
The second pass sorts atoms in {init,fini}_array.<priority> by
priority.
The problem is that the LayoutPass is overkill. It analyzes
references between atoms to make a decision how to sort them.
It's slow, hard to understand, and above all, it doesn't seem
that we need its feature for ELF in the first place.
This patch remove the LayoutPass from ELF pass list. Now all
reordering is done in elf::OrderPass. That pass sorts atoms by
{init,fini}_array, and if they are not in the special section,
they are ordered as the same order as they appear in the command
line. The new code is far easier to understand, faster, and
still able to create valid executables.
Unlike the previous layout pass, elf::OrderPass doesn't count
any attributes of an atom (e.g. permissions) except its
position. It's OK because the writer takes care of them if we
have to.
This patch changes the order of final output, although that's
benign. Tests are updated.
http://reviews.llvm.org/D7278
llvm-svn: 227666
2015-01-31 10:05:01 +08:00
|
|
|
ELF-hexagon: - name: global_variable
|
|
|
|
ELF-hexagon: - name: uninitialized_static_variable
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-hexagon: - name: special_section_func
|
2014-01-27 11:09:26 +08:00
|
|
|
ELF-hexagon: undefined-atoms:
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-hexagon: - name: puts
|
2014-01-27 11:09:26 +08:00
|
|
|
ELF-hexagon: absolute-atoms:
|
2013-09-12 23:43:09 +08:00
|
|
|
ELF-hexagon: - name: sample.c
|
|
|
|
ELF-hexagon: scope: static
|
|
|
|
ELF-hexagon: value: 0x0000000000000000
|