xref: /llvm-project/lld/test/ELF/relocatable-build-id.s (revision c5bfffed4831fd8ef3aa1fa3d9d4268d546bf6c5)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
3# RUN: ld.lld --build-id=0xcafebabe -o %t2.o %t1.o -r
4# RUN: ld.lld --build-id=0xdeadbeef -o %t.exe %t2.o
5# RUN: llvm-objdump -s %t.exe | FileCheck %s
6
7## The default --build-id=none removes .note.gnu.build-id input sections.
8# RUN: ld.lld %t2.o -o %t.none
9# RUN: llvm-readelf -S %t.none | FileCheck %s --check-prefix=NO
10# RUN: ld.lld --build-id=none %t2.o -o %t.none2
11# RUN: cmp %t.none %t.none2
12
13# CHECK: Contents of section .note.gnu.build-id:
14# CHECK-NOT: cafebabe
15# CHECK: deadbeef
16
17# NO:     Section Headers:
18# NO-NOT: .note.gnu.build-id
19
20.global _start
21_start:
22  ret
23