Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-objcopy/ELF/shared-strtab-shstrtab.s
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

107 lines
3.8 KiB
ArmAsm

# REQUIRES: x86-registered-target
## It is possible for the section header table and symbol table to share the
## same string table for storing section and symbol names. This test shows that
## under various circumstances, the names are still correct after llvm-objcopy
## has copied such an object file, and that the name table is still shared.
## This test uses the assembler rather than yaml2obj because yaml2obj generates
## separate string tables, whereas the assembler shares them.
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t.o
## Verify check that the string tables are shared:
# RUN: llvm-readobj --section-headers %t.o \
# RUN: | FileCheck %s --check-prefix=VALIDATE --implicit-check-not=.shstrtab
# VALIDATE: Name: .strtab
## Case 1: basic copy.
# RUN: llvm-objcopy %t.o %t.basic
# RUN: llvm-readobj --section-headers --symbols %t.basic \
# RUN: | FileCheck %s --check-prefix=BASIC --implicit-check-not=.shstrtab
# BASIC: Sections [
# BASIC: Name: .strtab (
# BASIC: Name: .foo (
# BASIC: Symbols [
# BASIC: Name: foo (
## Case 2: renaming a section.
# RUN: llvm-objcopy %t.o %t.rename-section --rename-section .foo=.oof
# RUN: llvm-readobj --section-headers --symbols %t.rename-section \
# RUN: | FileCheck %s --check-prefix=SECTION-RENAME --implicit-check-not=.shstrtab
# SECTION-RENAME: Sections [
# SECTION-RENAME: Name: .strtab (
# SECTION-RENAME: Name: .oof (
# SECTION-RENAME: Symbols [
# SECTION-RENAME: Name: foo (
## Case 3: renaming a symbol.
# RUN: llvm-objcopy %t.o %t.redefine-symbol --redefine-sym foo=oof
# RUN: llvm-readobj --section-headers --symbols %t.redefine-symbol \
# RUN: | FileCheck %s --check-prefix=SYMBOL-RENAME --implicit-check-not=.shstrtab
# SYMBOL-RENAME: Sections [
# SYMBOL-RENAME: Name: .strtab (
# SYMBOL-RENAME: Name: .foo (
# SYMBOL-RENAME: Symbols [
# SYMBOL-RENAME: Name: oof (
## Case 4: removing a section.
# RUN: llvm-objcopy %t.o %t.remove-section -R .foo
# RUN: llvm-readobj --section-headers --symbols %t.remove-section \
# RUN: | FileCheck %s --check-prefix=SECTION-REMOVE --implicit-check-not=.shstrtab --implicit-check-not=.foo
# SECTION-REMOVE: Sections [
# SECTION-REMOVE: Name: .strtab (
# SECTION-REMOVE: Symbols [
# SECTION-REMOVE: Name: foo (
## Case 5: removing a symbol.
# RUN: llvm-objcopy %t.o %t.remove-symbol -N foo
# RUN: llvm-readobj --section-headers --symbols %t.remove-symbol \
# RUN: | FileCheck %s --check-prefix=SYMBOL-REMOVE --implicit-check-not=.shstrtab --implicit-check-not="Name: foo"
# SYMBOL-REMOVE: Sections [
# SYMBOL-REMOVE: Name: .strtab (
# SYMBOL-REMOVE: Name: .foo (
# SYMBOL-REMOVE: Symbols [
## Case 6: adding a section.
# RUN: llvm-objcopy %t.o %t.add-section --add-section .bar=%s
# RUN: llvm-readobj --section-headers --symbols %t.add-section \
# RUN: | FileCheck %s --check-prefix=SECTION-ADD --implicit-check-not=.shstrtab
# SECTION-ADD: Sections [
# SECTION-ADD: Name: .strtab (
# SECTION-ADD: Name: .foo (
# SECTION-ADD: Name: .bar (
# SECTION-ADD: Symbols [
# SECTION-ADD: Name: foo (
## Case 7: adding a symbol.
# RUN: llvm-objcopy %t.o %t.add-symbol --add-symbol bar=0x1234
# RUN: llvm-readobj --section-headers --symbols %t.add-symbol \
# RUN: | FileCheck %s --check-prefix=SYMBOL-ADD --implicit-check-not=.shstrtab
# SYMBOL-ADD: Sections [
# SYMBOL-ADD: Name: .strtab (
# SYMBOL-ADD: Name: .foo (
# SYMBOL-ADD: Symbols [
# SYMBOL-ADD: Name: foo (
# SYMBOL-ADD: Name: bar (
## Case 8: removing all symbols.
# RUN: llvm-objcopy %t.o %t.strip-all --strip-all
# RUN: llvm-readobj --section-headers --symbols %t.strip-all \
# RUN: | FileCheck %s --check-prefix=STRIP-ALL --implicit-check-not=.shstrtab
# STRIP-ALL: Sections [
# STRIP-ALL: Name: .strtab (
# STRIP-ALL: Name: .foo (
# STRIP-ALL: Symbols [
# STRIP-ALL-NEXT: ]
.section .foo,"a",@progbits
foo = 0x4321