mirror of
https://github.com/sliverarmory/reflektor
synced 2026-08-25 09:14:48 +00:00
c7ee9636e9
Enable BOF and ELF shared-library loading on FreeBSD, including recursive dependency handling and exact symbol-version resolution. Add strict no-skip FreeBSD 15.1 QEMU coverage, a 25-object semantic BOF corpus per architecture, platform documentation, and the verified Sliver compile exception.
31 lines
778 B
Go
31 lines
778 B
Go
//go:build freebsd && (amd64 || arm64)
|
|
|
|
package reflektor_test
|
|
|
|
import (
|
|
"bytes"
|
|
"os"
|
|
"os/exec"
|
|
"path/filepath"
|
|
"strconv"
|
|
"testing"
|
|
)
|
|
|
|
func assertRecursiveDependenciesNotNativeLoaded(t *testing.T, graphDir string) {
|
|
t.Helper()
|
|
absDir, err := filepath.Abs(graphDir)
|
|
if err != nil {
|
|
t.Fatalf("resolve recursive graph directory: %v", err)
|
|
}
|
|
if evaluated, err := filepath.EvalSymlinks(absDir); err == nil {
|
|
absDir = evaluated
|
|
}
|
|
output, err := exec.Command("procstat", "-v", strconv.Itoa(os.Getpid())).CombinedOutput()
|
|
if err != nil {
|
|
t.Fatalf("procstat -v current process: %v\n%s", err, output)
|
|
}
|
|
if bytes.Contains(output, []byte(absDir)) {
|
|
t.Fatalf("recursive dependency graph appears in procstat output as an OS file mapping: %s\n%s", absDir, output)
|
|
}
|
|
}
|