Files
clang-p2996/lld/test/ELF/icf10.s
Fangrui Song e82f0838ae [ELF] --icf: don't fold a section without relocation and a section with relocations for SHT_CREL
Similar to commit 686cff17cc for SHT_REL (#57693).
CREL hasn't been tested with ICF before.

And avoid a pitfall that eqClass[0] might interfere with ICF.
2024-09-18 23:06:12 -07:00

26 lines
734 B
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=i686 %s -o %t.o
# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-freebsd %s -o %t.o
# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o --crel
# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | FileCheck %s
# Checks that ICF does not merge 2 sections the offset of
# the relocations of which differ.
# CHECK-NOT: selected
.section .text.orig,"ax"
.quad -1
.section .text.foo,"ax"
.quad -1
.reloc 0, BFD_RELOC_NONE, 0
.section .text.bar,"ax"
.quad -1
.reloc 1, BFD_RELOC_NONE, 0