[Offscreengecko-commits] SF.net SVN: offscreengecko:[99] trunk/bin/relaytool
Status: Pre-Alpha
Brought to you by:
res2002
|
From: <re...@us...> - 2008-11-02 23:03:54
|
Revision: 99
http://offscreengecko.svn.sourceforge.net/offscreengecko/?rev=99&view=rev
Author: res2002
Date: 2008-11-02 23:03:48 +0000 (Sun, 02 Nov 2008)
Log Message:
-----------
Mark weak relayed symbols as weak
Modified Paths:
--------------
trunk/bin/relaytool
Modified: trunk/bin/relaytool
===================================================================
--- trunk/bin/relaytool 2008-11-02 17:16:36 UTC (rev 98)
+++ trunk/bin/relaytool 2008-11-02 23:03:48 UTC (rev 99)
@@ -122,9 +122,11 @@
if $using_partial_map; then
functions=$( grep "^F " "$partial_map" | cut -d' ' -f2 )
variables=$( grep "^V " "$partial_map" | cut -d' ' -f2 )
+ variables_weak=
else
functions=$( nm --extern-only -D "$lib" | awk '{ if (($2 == "T") || ($2 == "W")) print $3; }' | LC_ALL=C grep -v '\(\<_init\>\|\<_fini\>\)' | LC_ALL=C sort -u )
- variables=$( nm --extern-only -D "$lib" | awk '{ if (($2 == "D") || ($2 == "G") || ($2 == "B") || ($2 == "V")) print $3; }' | LC_ALL=C sort -u )
+ variables=$( nm --extern-only -D "$lib" | awk '{ if (($2 == "D") || ($2 == "G") || ($2 == "B")) print $3; }' | LC_ALL=C sort -u )
+ variables_weak=$( nm --extern-only -D "$lib" | awk '{ if (($2 == "V")) print $3; }' | LC_ALL=C sort -u )
fi
if $using_minimal_list; then
functions="$functions
@@ -133,9 +135,12 @@
variables="$variables
$( nm `echo "$object_list"` | awk '{ if ($1 == "U") print $2; }' | LC_ALL=C sort -u )"
variables=$( echo "$variables" | LC_ALL=C sort | LC_ALL=C uniq -d )
+ variables_weak="$variables_weak
+$( nm `echo "$object_list"` | awk '{ if ($1 == "U") print $2; }' | LC_ALL=C sort -u )"
+ variables_weak=$( echo "$variables_weak" | LC_ALL=C sort | LC_ALL=C uniq -d )
fi
- if [ "$functions" == "" ] && [ "$variables" == "" ]; then
+ if [ "$functions" == "" ] && [ "$variables" == "" ] && [ "$variables_weak" == "" ]; then
# Nothing will be used, so do nothing for that lib
exit 1
fi
@@ -177,6 +182,9 @@
for s in $variables; do
echo " \"$s\"," >>"$outfile"
done
+ for s in $variables_weak; do
+ echo " \"$s\"," >>"$outfile"
+ done
echo " 0" >>"$outfile"
cat <<EOF >>"$outfile"
@@ -294,11 +302,15 @@
void* symptr;
EOF
- if [ "$variables" != "" ]; then echo " /* now fixup the global offset table for variable imports */" >>"$outfile"; fi
+ if [ "$variables" != "" ] || [ "$variables_weak" != "" ]; then echo " /* now fixup the global offset table for variable imports */" >>"$outfile"; fi
for s in $variables; do
echo " symptr = dlsym(handle, \"$s\");" >>"$outfile"
echo " FIXUP_GOT_RELOC( $s, symptr );" >>"$outfile"
done
+ for s in $variables_weak; do
+ echo " symptr = dlsym(handle, \"$s\");" >>"$outfile"
+ echo " FIXUP_GOT_RELOC( $s, symptr );" >>"$outfile"
+ done
cat <<EOF >>"$outfile"
}
@@ -366,6 +378,9 @@
for s in $variables; do
echo "int $s __attribute__(( visibility(\"hidden\") )) = -1;" >>"$outfile"
done
+ for s in $variables_weak; do
+ echo "int $s __attribute__((weak)) __attribute__(( visibility(\"hidden\") )) = -1;" >>"$outfile"
+ done
cat <<EOF >>"$outfile"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|