Files
clang-p2996/lld/test/elf/quickdata.test
Rui Ueyama 33ab83bc4b 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 02:05:01 +00:00

16 lines
572 B
Plaintext

RUN: lld -flavor gnu -target hexagon --output-filetype=yaml %p/Inputs/quickdata-test.elf-hexagon \
RUN: --noinhibit-exec | FileCheck %s -check-prefix hexagon
hexagon: - name: ac1
hexagon: scope: global
hexagon: type: zero-fill-quick
hexagon: size: 1
hexagon: merge: as-tentative
hexagon: - name: init
hexagon: scope: global
hexagon: type: quick-data
hexagon: - name: bss1
hexagon: scope: global
hexagon: type: zero-fill-quick