mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-23 03:10:05 +00:00
03d0a7e2aa
* Makefile (distribute): Add it.
24 lines
787 B
Bash
Executable File
24 lines
787 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Extract from an ELF shared object file just the dynamic symbols necessary
|
|
# to link against it and the (GNU extension) warning sections that linking
|
|
# against it may use to produce warning messages.
|
|
|
|
infile=$1
|
|
outfile=$2
|
|
|
|
# Handle both objdump -h output formats.
|
|
osechdr='^SECTION [0-9]+ \['
|
|
nsechdr='^ +[0-9]+ '
|
|
|
|
$OBJCOPY -S `$OBJDUMP -h $infile | $AWK "
|
|
/($osechdr|$nsechdr)"'\.(hash|dyn[a-z]+|gnu\.warning[a-zA-Z_.]*) / { next; }
|
|
/'"$osechdr"'/ { printf "--remove-section=%s ", $3 }
|
|
/'"$nsechdr"'/ { printf "--remove-section=%s ", $2 }
|
|
' |
|
|
# The old format puts brackets around section names. The new format fails
|
|
# to delimit long section names from the following hex digits.
|
|
sed -e 's/[][]//g' -e 's/0[0-9a-f]* / /g'` $infile $outfile.new
|
|
|
|
mv -f $outfile.new $outfile
|