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
164 lines
5.0 KiB
Plaintext
164 lines
5.0 KiB
Plaintext
## Show that llvm-readobj/llvm-readelf tools can dump the .dynamic section which
|
|
## is not alone in PT_DYNAMIC segment.
|
|
|
|
## In the first case .text is placed before .dynamic.
|
|
## We check that we warn about this case.
|
|
|
|
# RUN: yaml2obj --docnum=1 %s -o %t1.o
|
|
# RUN: llvm-readobj --dynamic-table %t1.o 2>&1 \
|
|
# RUN: | FileCheck %s --DFILE=%t1.o --check-prefixes=WARNING,LLVM
|
|
# RUN: llvm-readelf --dynamic-table %t1.o 2>&1 \
|
|
# RUN: | FileCheck %s --DFILE=%t1.o --check-prefixes=WARNING,GNU
|
|
|
|
# WARNING: warning: '[[FILE]]': SHT_DYNAMIC section with index 2 is not at the start of PT_DYNAMIC segment
|
|
# WARNING: warning: '[[FILE]]': invalid PT_DYNAMIC size (0x21){{$}}
|
|
# WARNING: warning: '[[FILE]]': SHT_DYNAMIC section header and PT_DYNAMIC program header disagree about the location of the dynamic table
|
|
# WARNING: warning: '[[FILE]]': PT_DYNAMIC dynamic table is invalid: SHT_DYNAMIC will be used
|
|
|
|
# LLVM: DynamicSection [ (2 entries)
|
|
# LLVM-NEXT: Tag Type Name/Value
|
|
# LLVM-NEXT: 0x0000000000000018 BIND_NOW 0x1
|
|
# LLVM-NEXT: 0x0000000000000000 NULL 0x0
|
|
# LLVM-NEXT: ]
|
|
|
|
# GNU: Dynamic section at offset 0x{{.*}} contains 2 entries:
|
|
# GNU-NEXT: Tag Type Name/Value
|
|
# GNU-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
|
|
# GNU-NEXT: 0x0000000000000000 (NULL) 0x0
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_EXEC
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [SHF_ALLOC]
|
|
Address: 0x1000
|
|
AddressAlign: 0x100
|
|
Content: "00"
|
|
- Name: .dynamic
|
|
Type: SHT_DYNAMIC
|
|
Flags: [SHF_ALLOC]
|
|
Address: 0x1001
|
|
Entries:
|
|
- Tag: DT_BIND_NOW
|
|
Value: 0x1
|
|
- Tag: DT_NULL
|
|
Value: 0x0
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
VAddr: 0x1000
|
|
FirstSec: .text
|
|
LastSec: .dynamic
|
|
- Type: PT_DYNAMIC
|
|
VAddr: 0x1000
|
|
FirstSec: .text
|
|
LastSec: .dynamic
|
|
|
|
## In this case .text goes after .dynamic and we don't display any warnings,
|
|
## though the content of the .text is used for dumping the dynamic table.
|
|
|
|
# RUN: yaml2obj --docnum=2 %s -o %t2.o
|
|
# RUN: llvm-readobj --dynamic-table %t2.o 2>&1 | FileCheck %s --check-prefix=LLVM2
|
|
# RUN: llvm-readelf --dynamic-table %t2.o 2>&1 | FileCheck %s --check-prefix=GNU2
|
|
|
|
# LLVM2: DynamicSection [ (3 entries)
|
|
# LLVM2-NEXT: Tag Type Name/Value
|
|
# LLVM2-NEXT: 0x0000000000000018 BIND_NOW 0x1
|
|
# LLVM2-NEXT: 0x0000000000000018 BIND_NOW 0x2
|
|
# LLVM2-NEXT: 0x0000000000000000 NULL 0x0
|
|
# LLVM2-NEXT: ]
|
|
|
|
# GNU2: Dynamic section at offset 0x{{.*}} contains 3 entries:
|
|
# GNU2-NEXT: Tag Type Name/Value
|
|
# GNU2-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
|
|
# GNU2-NEXT: 0x0000000000000018 (BIND_NOW) 0x2
|
|
# GNU2-NEXT: 0x0000000000000000 (NULL) 0x0
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_EXEC
|
|
Sections:
|
|
- Name: .dynamic
|
|
Type: SHT_DYNAMIC
|
|
Flags: [SHF_ALLOC]
|
|
Address: 0x1000
|
|
AddressAlign: 0x1000
|
|
Entries:
|
|
- Tag: DT_BIND_NOW
|
|
Value: 0x1
|
|
- Tag: DT_BIND_NOW
|
|
Value: 0x2
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [SHF_ALLOC]
|
|
Address: 0x1100
|
|
AddressAlign: 0x100
|
|
Content: "00000000000000000000000000000000"
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
VAddr: 0x1000
|
|
FirstSec: .dynamic
|
|
LastSec: .text
|
|
- Type: PT_DYNAMIC
|
|
VAddr: 0x1000
|
|
FirstSec: .dynamic
|
|
LastSec: .text
|
|
|
|
## In this case .text goes after .dynamic, but (PT_DYNAMIC segment size % dynamic entry size != 0)
|
|
## and we have to use the information from the section header instead.
|
|
|
|
# RUN: yaml2obj --docnum=3 %s -o %t3.o
|
|
# RUN: llvm-readobj --dynamic-table %t3.o 2>&1 | FileCheck %s --DFILE=%t3.o --check-prefixes=WARNING2,LLVM3
|
|
# RUN: llvm-readelf --dynamic-table %t3.o 2>&1 | FileCheck %s --DFILE=%t3.o --check-prefixes=WARNING2,GNU3
|
|
|
|
# WARNING2: warning: '[[FILE]]': invalid PT_DYNAMIC size (0x101){{$}}
|
|
# WARNING2: warning: '[[FILE]]': PT_DYNAMIC dynamic table is invalid: SHT_DYNAMIC will be used
|
|
|
|
# LLVM3: DynamicSection [ (2 entries)
|
|
# LLVM3-NEXT: Tag Type Name/Value
|
|
# LLVM3-NEXT: 0x0000000000000018 BIND_NOW 0x1
|
|
# LLVM3-NEXT: 0x0000000000000000 NULL 0x0
|
|
# LLVM3-NEXT: ]
|
|
|
|
# GNU3: Dynamic section at offset 0x{{.*}} contains 2 entries:
|
|
# GNU3-NEXT: Tag Type Name/Value
|
|
# GNU3-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
|
|
# GNU3-NEXT: 0x0000000000000000 (NULL) 0x0
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_EXEC
|
|
Sections:
|
|
- Name: .dynamic
|
|
Type: SHT_DYNAMIC
|
|
Flags: [SHF_ALLOC]
|
|
Address: 0x1000
|
|
AddressAlign: 0x1000
|
|
Entries:
|
|
- Tag: DT_BIND_NOW
|
|
Value: 0x1
|
|
- Tag: DT_NULL
|
|
Value: 0x0
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Flags: [SHF_ALLOC]
|
|
Address: 0x1100
|
|
AddressAlign: 0x100
|
|
Content: "00"
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
VAddr: 0x1000
|
|
FirstSec: .dynamic
|
|
LastSec: .text
|
|
- Type: PT_DYNAMIC
|
|
VAddr: 0x1000
|
|
FirstSec: .dynamic
|
|
LastSec: .text
|