
Linux Standard Base Core Specification says that CIE/FDE is padded to an addressing unit size boundary, but in practice GNU assembler/LLVM integrated assembler pad FDE/CIE to 4 and the last FDE to 8 on 64-bit systems. In addition, GNU ld doesn't pad to 8, so let's drop excess padding, too. If the assembler provides aligned pieces, the output will be aligned. Noticed .eh_frame size reduction for 3 executables: 0.3% (chrome), 4.7% (clang), 7.6% (an internal program).
51 lines
1.1 KiB
ArmAsm
51 lines
1.1 KiB
ArmAsm
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
|
|
# RUN: ld.lld --eh-frame-hdr -shared %t.o -o %t.so
|
|
# RUN: llvm-dwarfdump --eh-frame %t.so | FileCheck %s
|
|
|
|
# CHECK: 00000000 00000014 00000000 CIE
|
|
# CHECK: Augmentation:
|
|
# CHECK-SAME: "zR"
|
|
|
|
# CHECK: 00000018 00000010 0000001c FDE cie=00000000 {{.*}}
|
|
|
|
# CHECK: 0000002c 00000018 00000000 CIE
|
|
# CHECK: Augmentation:
|
|
# CHECK-SAME: "zPR"
|
|
# CHECK: Personality Address:
|
|
|
|
# CHECK: 00000048 00000010 00000020 FDE cie=0000002c {{.*}}
|
|
|
|
# CHECK: 0000005c 00000018 00000000 CIE
|
|
# CHECK: Augmentation:
|
|
# CHECK-SAME: "zPR"
|
|
# CHECK: Personality Address:
|
|
|
|
# CHECK: 00000078 00000014 00000020 FDE cie=0000005c {{.*}}
|
|
|
|
foo0:
|
|
.cfi_startproc
|
|
.cfi_personality 0x9b, personality0
|
|
ret
|
|
.cfi_endproc
|
|
|
|
## This CIE cannot be merged into the previous one because the Personality is different.
|
|
foo1:
|
|
.cfi_startproc
|
|
.cfi_personality 0x9b, personality1
|
|
ret
|
|
.cfi_endproc
|
|
|
|
bar:
|
|
.cfi_startproc
|
|
ret
|
|
.cfi_endproc
|
|
|
|
.globl personality0, personality1
|
|
.hidden personality0, personality1
|
|
personality0:
|
|
ret
|
|
|
|
personality1:
|
|
ret
|