<commit_before>#!/bin/sh
#
# Purpose of this script is to check library exported symbols
#

SYMTMPFILE=symbols.txt

function grep_sym
{
	if objdump --syms "$1" |grep "$2" 2>&1 > /dev/null; then
		echo -e "\t$1"
	fi
}

function find_symbol
{
	echo "SYM $1:"
	
	find ../libs/ -name '*.o' | while read obj; do grep_sym "$obj" "$1"; done
}

function get_symbols
{
	objdump --dynamic-syms "$1" | awk 'NR > 4 { print }' | awk '$3 != "*UND*"' | awk '{print $NF}'  > "$2"

	#
	# Remove compiler and glibc symbols
	#
	sed -i '/^.init$/d' "$2"
	sed -i '/^__.*$/d' "$2"
	sed -i '/^_.*$/d' "$2"
}

function check_symbols
{
	local symfile=$1
	shift

	for i in `cat $symfile`; do
		if ! grep $i $@ 2>&1 > /dev/null; then
			find_symbol "$i"
		fi
	done
}

function do_check
{
	get_symbols "$1" $SYMTMPFILE
	shift
	check_symbols $SYMTMPFILE "$@"
	rm $SYMTMPFILE
}
<commit_msg>build: Fix check_symbols.sh script.<commit_after>#!/bin/sh
#
# Purpose of this script is to check library exported symbols
#

SYMTMPFILE=symbols.txt

function grep_sym
{
	if objdump --syms "$1" |grep "$2" 2>&1 > /dev/null; then
		echo -e "\t$1"
	fi
}

function find_symbol
{
	echo "SYM $1:"
	
	find ../libs/ -name '*.o' | while read obj; do grep_sym "$obj" "$1"; done
}

function get_symbols
{
	objdump --dynamic-syms "$1" | awk 'NR > 4 { print }' | awk '$3 != "*UND*"' | awk '{print $NF}'  > "$2"

	#
	# Remove compiler and glibc symbols
	#
	sed -i '/^.init$/d' "$2"
	sed -i '/^__.*$/d' "$2"
	sed -i '/^_.*$/d' "$2"
}

function check_symbols
{
	local symfile=$1
	shift

	for i in `cat $symfile`; do
		if ! grep "^$i$" $@ 2>&1 > /dev/null; then
			find_symbol "$i"
		fi
	done
}

function do_check
{
	get_symbols "$1" $SYMTMPFILE
	shift
	check_symbols $SYMTMPFILE "$@"
	rm $SYMTMPFILE
}

{'fraction_non_alphanumeric': 0.19072164948453607, 'fraction_numerical': 0.020618556701030927, 'mean_word_length': 3.1202830188679247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1320270', 'n_tokens_mistral': 798, 'n_tokens_neox': 746, 'n_words': 219}