llvm-project/lld/test/ELF/gnu-ifunc-empty.s
Rui Ueyama 6f9d49cdde Do not emit a corrupt symbol table entry for .rela_iplt_{start,end}.
If .rela.iplt does not exist, we used to emit a corrupt symbol table
that contains two symbols, .rela_iplt_{start,end}, pointing to a
nonexisting section.

This patch fixes the issue by setting section index 0 to the symbols
if .rel.iplt section does not exist.

Differential Revision: https://reviews.llvm.org/D56623

llvm-svn: 351218
2019-01-15 18:30:23 +00:00

17 lines
487 B
ArmAsm

// REQUIRES: x86
// Verifies that .rela_iplt_{start,end} point to a dummy section
// if .rela.iplt does not exist.
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: ld.lld -static %t.o -o %t.exe
// RUN: llvm-objdump -syms %t.exe | FileCheck %s
// CHECK: 0000000000200000 .text 00000000 .hidden __rela_iplt_end
// CHECK: 0000000000200000 .text 00000000 .hidden __rela_iplt_start
.globl _start
_start:
movl $__rela_iplt_start, %edx
movl $__rela_iplt_end, %edx