Files
clang-p2996/lld/test/ELF/linkerscript/orphan-report.s
George Rimar 9524dee72e [ELF] - Implement SHT_SYMTAB_SHNDX (.symtab_shndxr) section.
This is relative to https://bugs.llvm.org//show_bug.cgi?id=38119.

SHT_SYMTAB section is able to keep symbols with output section indices
up to 0xff00 (SHN_LORESERVE). But if we have indices that are greater
than that (PR shows that it might happen), we need to use
SHT_SYMTAB_SHNDX extended section. It was not supported by LLD.

Description of the SHT_SYMTAB_SHNDX section is here:
https://docs.oracle.com/cd/E19683-01/817-3677/chapter6-94076/index.html.

Differential revision: https://reviews.llvm.org/D49541

llvm-svn: 338247
2018-07-30 12:39:54 +00:00

56 lines
2.8 KiB
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: echo "SECTIONS { .text : { *(.text.1) } }" > %t.script
## Check we do not report orphans by default even with -verbose.
# RUN: ld.lld -shared -o %t.out --script %t.script %t.o 2>&1 -verbose \
# RUN: | FileCheck %s --check-prefix=DEFAULT
# DEFAULT-NOT: placed
## Check --orphan-handling=place has the same behavior as default.
# RUN: ld.lld -shared --orphan-handling=place -o %t.out --script %t.script \
# RUN: %t.o 2>&1 -verbose -error-limit=0 | FileCheck %s --check-prefix=DEFAULT
## Check --orphan-handling=error reports errors about orphans.
# RUN: not ld.lld -shared --orphan-handling=error -o %t.out --script %t.script \
# RUN: %t.o 2>&1 -verbose -error-limit=0 | FileCheck %s --check-prefix=REPORT
# REPORT: {{.*}}.o:(.text) is being placed in '.text'
# REPORT-NEXT: {{.*}}.o:(.text.2) is being placed in '.text'
# REPORT-NEXT: <internal>:(.comment) is being placed in '.comment'
# REPORT-NEXT: <internal>:(.bss) is being placed in '.bss'
# REPORT-NEXT: <internal>:(.bss.rel.ro) is being placed in '.bss.rel.ro'
# REPORT-NEXT: <internal>:(.dynsym) is being placed in '.dynsym'
# REPORT-NEXT: <internal>:(.gnu.version) is being placed in '.gnu.version'
# REPORT-NEXT: <internal>:(.gnu.version_r) is being placed in '.gnu.version_r'
# REPORT-NEXT: <internal>:(.gnu.hash) is being placed in '.gnu.hash'
# REPORT-NEXT: <internal>:(.hash) is being placed in '.hash'
# REPORT-NEXT: <internal>:(.dynamic) is being placed in '.dynamic'
# REPORT-NEXT: <internal>:(.dynstr) is being placed in '.dynstr'
# REPORT-NEXT: <internal>:(.rela.dyn) is being placed in '.rela.dyn'
# REPORT-NEXT: <internal>:(.got) is being placed in '.got'
# REPORT-NEXT: <internal>:(.got.plt) is being placed in '.got.plt'
# REPORT-NEXT: <internal>:(.got.plt) is being placed in '.got.plt'
# REPORT-NEXT: <internal>:(.rela.plt) is being placed in '.rela.plt'
# REPORT-NEXT: <internal>:(.rela.plt) is being placed in '.rela.plt'
# REPORT-NEXT: <internal>:(.plt) is being placed in '.plt'
# REPORT-NEXT: <internal>:(.plt) is being placed in '.plt'
# REPORT-NEXT: <internal>:(.eh_frame) is being placed in '.eh_frame'
# REPORT-NEXT: <internal>:(.symtab) is being placed in '.symtab'
# REPORT-NEXT: <internal>:(.symtab_shndxr) is being placed in '.symtab_shndxr'
# REPORT-NEXT: <internal>:(.shstrtab) is being placed in '.shstrtab'
# REPORT-NEXT: <internal>:(.strtab) is being placed in '.strtab'
## Check --orphan-handling=warn reports warnings about orphans.
# RUN: ld.lld -shared --orphan-handling=warn -o %t.out --script %t.script \
# RUN: %t.o 2>&1 -verbose | FileCheck %s --check-prefix=REPORT
# RUN: not ld.lld --orphan-handling=foo -o %t.out --script %t.script %t.o 2>&1 \
# RUN: | FileCheck %s --check-prefix=UNKNOWN
# UNKNOWN: unknown --orphan-handling mode: foo
.section .text.1,"a"
nop
.section .text.2,"a"
nop