#!/bin/sh1# SPDX-License-Identifier: GPL-2.02#3# Certain function names are disallowed due to section name ambiguities4# introduced by -ffunction-sections.5#6# See the comment above TEXT_MAIN in include/asm-generic/vmlinux.lds.h.78objfile="$1"910if [ ! -f "$objfile" ]; then11echo "usage: $0 <file.o>" >&212exit 113fi1415bad_symbols=$(nm "$objfile" | awk '$2 ~ /^[TtWw]$/ {print $3}' | grep -E '^(startup|exit|split|unlikely|hot|unknown)(\.|$)')1617if [ -n "$bad_symbols" ]; then18echo "$bad_symbols" | while read -r sym; do19echo "$objfile: error: $sym() function name creates ambiguity with -ffunction-sections" >&220done21exit 122fi2324exit 0252627