Skip to content

Commit

Permalink
Enable most tests on FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
yugr committed Apr 15, 2024
1 parent 051c584 commit dbac8c9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions implib-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,19 @@ def collect_relocs(f):
error("multiple headers in output of readelf")
words = re.split(r'\s\s+', line) # "Symbol's Name + Addend"
toc = make_toc(words)
elif re.match(r'^\s*r_offset', line): # FreeBSD header?
if toc is not None:
error("multiple headers in output of readelf")
words = re.split(r'\s\s+', line) # "st_name + r_addend"
toc = make_toc(words)
rename = {
'r_offset' : 'Offset',
'r_info' : 'Info',
'r_type' : 'Type',
'st_value' : 'Symbol\'s Value',
'st_name + r_addend' : 'Symbol\'s Name + Addend',
}
toc = {idx : rename[name] for idx, name in toc.items()}
elif toc is not None:
line = re.sub(r' \+ ', '+', line)
words = re.split(r'\s+', line)
Expand Down
7 changes: 7 additions & 0 deletions scripts/install-freebsd-prereqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -eu

pkg update
pkg upgrade
pkg install gcc g++ binutils python3
1 change: 1 addition & 0 deletions tests/basic/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fi
. ../common.sh

CFLAGS="-g -O2 $CFLAGS"
CFLAGS="-Wno-unused-command-line-argument $CFLAGS" # For -no-pie on BSD

# Build shlib to test against
$CC $CFLAGS -shared -fPIC interposed.c -o libinterposed.so
Expand Down

0 comments on commit dbac8c9

Please sign in to comment.