Files
clang-p2996/lld/test/elf/init_array-order.test
Shankar Easwaran 07f6ce0b83 [ELF] OrderPass : Order atoms only by ordinals.
Move the init array/fini array sorting to the Output ELF writer.

AFAIK, this is only needed by the X86_64/ARM ABI.

This shaves time taken to self host lld by 0.2 seconds.

Before patch
----------------
4791.062059 task-clock                #    1.634 CPUs utilized            ( +-  0.28% )
     61,107 context-switches          #    0.013 M/sec                    ( +-  0.56% )
2.932902671 seconds time elapsed                                          ( +-  0.84% )

After patch
-------------
4608.417248 task-clock                #    1.669 CPUs utilized            ( +-  0.30% )
     61,616 context-switches          #    0.013 M/sec                    ( +-  0.63% )
2.761012703 seconds time elapsed                                          ( +-  0.63% )

llvm-svn: 232866
2015-03-20 23:47:03 +00:00

68 lines
1.5 KiB
Plaintext

#RUN: yaml2obj -format=elf %s > %t
#RUN: lld -flavor gnu -target x86_64-linux %t --noinhibit-exec \
#RUN: -o %t1.out
#RUN: llvm-objdump -s %t1.out | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Content: "1100000000000000"
AddressAlign: 8
Flags: [SHF_ALLOC, SHF_EXECINSTR]
- Name: .init_array.2
Type: SHT_INIT_ARRAY
Content: "0200000000000000"
AddressAlign: 8
Flags: [SHF_ALLOC]
- Name: .init_array.3
Type: SHT_INIT_ARRAY
Content: "0300000000000000"
AddressAlign: 8
Flags: [SHF_ALLOC]
- Name: .init_array
Type: SHT_INIT_ARRAY
Content: "9900000000000000"
AddressAlign: 8
Flags: [SHF_ALLOC]
- Name: .data
Type: SHT_PROGBITS
Content: "2200000000000000"
AddressAlign: 8
Flags: [SHF_ALLOC, SHF_WRITE]
- Name: .init_array.1
Type: SHT_INIT_ARRAY
Content: "0100000000000000"
AddressAlign: 8
Flags: [SHF_ALLOC]
Symbols:
Local:
- Name: .text
Type: STT_SECTION
Section: .text
- Name: .data
Type: STT_SECTION
Section: .data
- Name: .init_array.3
Type: STT_SECTION
Section: .init_array.3
- Name: .init_array.2
Type: STT_SECTION
Section: .init_array.2
- Name: .init_array.1
Type: STT_SECTION
Section: .init_array.1
- Name: .init_array
Type: STT_SECTION
Section: .init_array
#CHECK: {{[0xa-f0-9]+}} 01000000 00000000 02000000 00000000
#CHECK: {{[0xa-f0-9]+}} 03000000 00000000 99000000 00000000