cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
195 lines
4.2 KiB
ArmAsm
195 lines
4.2 KiB
ArmAsm
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
|
# RUN: ld.lld %t -o %t2
|
|
# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=NOGC %s
|
|
# RUN: ld.lld --gc-sections --print-gc-sections %t -o %t2 | FileCheck --check-prefix=GC1-DISCARD %s
|
|
# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC1 %s
|
|
# RUN: ld.lld -pie --export-dynamic --gc-sections %t -o %t2
|
|
# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC2 %s
|
|
|
|
## In non-pie static linking, --export-dynamic currently retains the global 'd' even if it is not exported.
|
|
# RUN: ld.lld --export-dynamic --gc-sections --print-gc-sections %t -o %t1
|
|
# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC2 %s
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 --crel %s -o %t.o
|
|
# RUN: ld.lld -pie --gc-sections --print-gc-sections %t.o -o %t2 | FileCheck --check-prefix=GC1-DISCARD %s
|
|
# RUN: llvm-readobj --sections --symbols %t2 | FileCheck -check-prefix=GC1 %s
|
|
|
|
# NOGC: Name: .eh_frame
|
|
# NOGC: Name: .text
|
|
# NOGC: Name: .init
|
|
# NOGC: Name: .init_x
|
|
# NOGC: Name: .fini
|
|
# NOGC: Name: .tdata
|
|
# NOGC: Name: .tbss
|
|
# NOGC: Name: .ctors
|
|
# NOGC: Name: .dtors
|
|
# NOGC: Name: .fini_array
|
|
# NOGC: Name: .init_array
|
|
# NOGC: Name: .preinit_array
|
|
# NOGC: Name: .jcr
|
|
# NOGC: Name: .jcr_x
|
|
# NOGC: Name: .debug_pubtypes
|
|
# NOGC: Name: .comment
|
|
# NOGC: Name: a
|
|
# NOGC: Name: b
|
|
# NOGC: Name: c
|
|
# NOGC: Name: e
|
|
# NOGC: Name: f
|
|
# NOGC: Name: g
|
|
# NOGC: Name: h
|
|
# NOGC: Name: x
|
|
# NOGC: Name: y
|
|
# NOGC: Name: d
|
|
|
|
# GC1-DISCARD: removing unused section {{.*}}:(.text.d)
|
|
# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.text.x)
|
|
# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.text.y)
|
|
# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.tbss.f)
|
|
# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.tdata.h)
|
|
# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.init_x)
|
|
# GC1-DISCARD-NEXT: removing unused section {{.*}}:(.jcr_x)
|
|
# GC1-DISCARD-EMPTY:
|
|
|
|
# GC1: Name: .eh_frame
|
|
# GC1: Name: .text
|
|
# GC1: Name: .init
|
|
# GC1: Name: .fini
|
|
# GC1: Name: .tdata
|
|
# GC1: Name: .tbss
|
|
# GC1: Name: .ctors
|
|
# GC1: Name: .dtors
|
|
# GC1: Name: .fini_array
|
|
# GC1: Name: .init_array
|
|
# GC1: Name: .preinit_array
|
|
# GC1: Name: .jcr
|
|
# GC1: Name: .debug_pubtypes
|
|
# GC1: Name: .comment
|
|
# GC1: Name: a
|
|
# GC1: Name: b
|
|
# GC1: Name: c
|
|
# GC1: Name: e
|
|
# GC1-NOT: Name: f
|
|
# GC1: Name: g
|
|
# GC1-NOT: Name: h
|
|
# GC1-NOT: Name: x
|
|
# GC1-NOT: Name: y
|
|
# GC1-NOT: Name: d
|
|
|
|
# GC2: Name: .eh_frame
|
|
# GC2: Name: .text
|
|
# GC2: Name: .init
|
|
# GC2: Name: .fini
|
|
# GC2: Name: .tdata
|
|
# GC2: Name: .tbss
|
|
# GC2: Name: .ctors
|
|
# GC2: Name: .dtors
|
|
# GC2: Name: .fini_array
|
|
# GC2: Name: .init_array
|
|
# GC2: Name: .preinit_array
|
|
# GC2: Name: .jcr
|
|
# GC2: Name: .debug_pubtypes
|
|
# GC2: Name: .comment
|
|
# GC2: Name: a
|
|
# GC2: Name: b
|
|
# GC2: Name: c
|
|
# GC2: Name: e
|
|
# GC2-NOT: Name: f
|
|
# GC2: Name: g
|
|
# GC2-NOT: Name: h
|
|
# GC2-NOT: Name: x
|
|
# GC2-NOT: Name: y
|
|
# GC2: Name: d
|
|
|
|
.globl _start, d
|
|
.protected a, b, c, e, f, g, h, x, y
|
|
_start:
|
|
call a
|
|
|
|
.section .text.a,"ax",@progbits
|
|
a:
|
|
call _start
|
|
call b
|
|
|
|
.section .text.b,"ax",@progbits
|
|
b:
|
|
leaq e@tpoff(%rax),%rdx
|
|
call c
|
|
|
|
.section .text.c,"ax",@progbits
|
|
c:
|
|
leaq g@tpoff(%rax),%rdx
|
|
|
|
.section .text.d,"ax",@progbits
|
|
d:
|
|
nop
|
|
|
|
.section .text.x,"ax",@progbits
|
|
x:
|
|
call y
|
|
|
|
.section .text.y,"ax",@progbits
|
|
y:
|
|
call x
|
|
|
|
.section .tbss.e,"awT",@nobits
|
|
e:
|
|
.quad 0
|
|
|
|
.section .tbss.f,"awT",@nobits
|
|
f:
|
|
.quad 0
|
|
|
|
.section .tdata.g,"awT",@progbits
|
|
g:
|
|
.quad 0
|
|
|
|
.section .tdata.h,"awT",@progbits
|
|
h:
|
|
.quad 0
|
|
|
|
.section .ctors,"aw",@progbits
|
|
.quad 0
|
|
|
|
.section .dtors,"aw",@progbits
|
|
.quad 0
|
|
|
|
.section .init,"ax"
|
|
.quad 0
|
|
|
|
.section .init_x,"ax"
|
|
.quad 0
|
|
|
|
.section .fini,"ax"
|
|
.quad 0
|
|
|
|
.section .fini_array,"aw",@fini_array
|
|
.quad 0
|
|
|
|
# https://golang.org/cl/373734
|
|
.section .init_array,"aw",@progbits
|
|
.quad 0
|
|
|
|
# Work around https://github.com/rust-lang/rust/issues/92181
|
|
.section .init_array.00001,"aw",@progbits
|
|
.quad 0
|
|
|
|
.section .preinit_array,"aw",@preinit_array
|
|
.quad 0
|
|
|
|
.section .jcr,"aw"
|
|
.quad 0
|
|
|
|
.section .jcr_x,"aw"
|
|
.quad 0
|
|
|
|
.section .eh_frame,"a",@unwind
|
|
.quad 0
|
|
|
|
.section .debug_pubtypes,"",@progbits
|
|
.quad 0
|
|
|
|
.section .comment,"MS",@progbits,8
|
|
.quad 0
|