
LLVM ObjectFile currently records the start offsets of sections as the start of the section header, whereas most other tools (WABT, emscripten, wasm-tools) record it as the start of the section content, after the header. This affects binutils tools such as objdump and nm, but not compilation/assembly (since that is driven by symbols and assembler labels which already have their values inside the section payload rather in the header. This patch updates LLVM to match the other tools.
33 lines
732 B
LLVM
33 lines
732 B
LLVM
; RUN: llc -filetype=obj %s -o - | llvm-readobj -S - | FileCheck %s
|
|
|
|
; Test the mechanism for defining user custom sections.
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
!0 = !{ !"red", !"foo" }
|
|
!1 = !{ !"green", !"bar" }
|
|
!2 = !{ !"green", !"qux" }
|
|
!wasm.custom_sections = !{ !0, !1, !2 }
|
|
|
|
!3 = !{ !"clang version 123"}
|
|
!llvm.ident = !{!3}
|
|
|
|
; CHECK: Section {
|
|
; CHECK: Type: CUSTOM (0x0)
|
|
; CHECK: Size: 3
|
|
; CHECK: Offset: 44
|
|
; CHECK: Name: red
|
|
; CHECK: }
|
|
; CHECK: Section {
|
|
; CHECK: Type: CUSTOM (0x0)
|
|
; CHECK: Size: 6
|
|
; CHECK: Offset: 57
|
|
; CHECK: Name: green
|
|
; CHECK: }
|
|
; CHECK: Section {
|
|
; CHECK: Type: CUSTOM (0x0)
|
|
; CHECK: Size: 25
|
|
; CHECK: Offset: 90
|
|
; CHECK: Name: producers
|
|
; CHECK: }
|