Files
lkl_linux/arch/lkl/scripts/cc-objdump-file-format.sh
2025-08-21 22:44:29 +03:00

9 lines
259 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# Print the C compiler output file format, as determined by objdump.
t=`mktemp` || exit 1
echo 'void foo(void) {}' | $CC -x c - -c -o "$t" \
&& LC_ALL=C $OBJDUMP -p "$t" | awk '/file format/ {print $4}'
rm "$t"