2 # SPDX-License-Identifier: GPL-2.0
4 # Check whether linker can handle cross-segment @segrel():
14 # Check whether cross-segment segment-relative relocs work fine. We need
15 # that for building the gate DSO:
17 $CC -nostdlib -static -Wl,-T$dir/check-segrel.lds $dir/check-segrel.S -o $out
18 res=$($OBJDUMP --full --section .rodata $out | fgrep 000 | cut -f3 -d' ')
20 if [ $res != 00000a00 ]; then
21 CPPFLAGS="$CPPFLAGS -DHAVE_BUGGY_SEGREL"
23 warning: your linker cannot handle cross-segment segment-relative relocations.
24 please upgrade to a newer version (it is safe to use this linker, but
25 the kernel will be bigger than strictly necessary).
29 # Check whether .align inside a function works as expected.
31 $CC -c $dir/check-text-align.S -o $out
32 $READELF -u $out | fgrep -q 'prologue(rlen=12)'
35 if [ $res -eq 0 ]; then
36 CPPFLAGS="$CPPFLAGS -DHAVE_WORKING_TEXT_ALIGN"
39 if ! $CC -c $dir/check-model.c -o $out 2>&1 | grep __model__ | grep -q attrib
41 CPPFLAGS="$CPPFLAGS -DHAVE_MODEL_SMALL_ATTRIBUTE"
45 # Check whether assembler supports .serialize.{data,instruction} directive.
47 $CC -c $dir/check-serialize.S -o $out 2>/dev/null
50 if [ $res -eq 0 ]; then
51 CPPFLAGS="$CPPFLAGS -DHAVE_SERIALIZE_DIRECTIVE"