Fix BPF ELF layout (#16256)

* Fix BPF ELF layout

* whitespace
This commit is contained in:
Jack May 2021-03-31 01:51:19 -07:00 committed by GitHub
parent 2c94c6f8e8
commit bcd89dd34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -10,11 +10,6 @@ SECTIONS
. = SIZEOF_HEADERS; . = SIZEOF_HEADERS;
.text : { *(.text*) } :text .text : { *(.text*) } :text
.rodata : { *(.rodata*) } :rodata .rodata : { *(.rodata*) } :rodata
.data.rel.ro : { *(.data.rel.ro*) } :rodata
.dynamic : { *(.dynamic) } :dynamic .dynamic : { *(.dynamic) } :dynamic
.data.rel.ro : { *(.data.rel.ro*) } :dynamic
.dynsym : { *(.dynsym) } :dynamic
.dynstr : { *(.dynstr) } :dynamic
.gnu.hash : { *(.gnu.hash) } :dynamic
.rel.dyn : { *(.rel.dyn) } :dynamic
.hash : { *(.hash) } :dynamic
} }

View File

@ -7,17 +7,17 @@ source "$bpf_sdk"/env.sh
so=$1 so=$1
dump=$2 dump=$2
if [[ -z $so ]] || [[ -z $dump ]]; then if [[ -z $so ]] || [[ -z $dump ]]; then
echo "Usage: $0 bpf-program.so dump.txt" echo "Usage: $0 bpf-program.so dump.txt" >&2
exit 1 exit 1
fi fi
if [[ ! -r $so ]]; then if [[ ! -r $so ]]; then
echo "Error: File not found or readable: $so" echo "Error: File not found or readable: $so" >&2
exit 1 exit 1
fi fi
if ! command -v rustfilt > /dev/null; then if ! command -v rustfilt > /dev/null; then
echo "Error: rustfilt not found. It can be installed by running: cargo install rustfilt" echo "Error: rustfilt not found. It can be installed by running: cargo install rustfilt" >&2
exit 1 exit 1
fi fi
@ -38,8 +38,9 @@ dump_mangled=$dump.mangled
rm -f "$dump_mangled" rm -f "$dump_mangled"
if [[ ! -f "$dump" ]]; then if [[ ! -f "$dump" ]]; then
echo "Error: Failed to create $dump" echo "Error: Failed to create $dump" >&2
exit 1 exit 1
fi fi
echo "Wrote $dump" echo >&2
echo "Wrote $dump" >&2