From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2062 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: libc.so comparision script Date: Mon, 8 Oct 2012 18:44:10 +0200 Message-ID: <20121008164410.GG24157@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="hQiwHBbRI9kgIhsi" X-Trace: ger.gmane.org 1349714664 3319 80.91.229.3 (8 Oct 2012 16:44:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2012 16:44:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2063-gllmg-musl=m.gmane.org@lists.openwall.com Mon Oct 08 18:44:30 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TLGRS-0007dy-94 for gllmg-musl@plane.gmane.org; Mon, 08 Oct 2012 18:44:30 +0200 Original-Received: (qmail 5661 invoked by uid 550); 8 Oct 2012 16:44:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5653 invoked from network); 8 Oct 2012 16:44:22 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2062 Archived-At: --hQiwHBbRI9kgIhsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline i wrote a silly script that compares symbols in glibc and musl libc.so i added it to my musl-tools repo it didn't reveal anything interesting other than a few foo64 weak symbols which are supposed to be for glibc compatibility, but only musl has them --hQiwHBbRI9kgIhsi Content-Type: application/x-sh Content-Disposition: attachment; filename="so_cmp.sh" Content-Transfer-Encoding: quoted-printable #!/bin/sh=0A=0Aexport LC_ALL=3DC=0A=0AD=3Ddata=0AM=3D/lib=0AG=3D/lib=0A=0A#= list symbol info in tab separated format:=0A# name versioning type visibil= ity addr size Ndx lib=0Asyms() {=0A readelf -W -d -s $1 |awk -v lib=3D$1 '= =0A/^ *[0-9]*:/ && $5 !=3D "LOCAL" && $7 !~ /UND|ABS/ {=0A sub(/@/," @")=0A= ver =3D $9=0A if ($10)=0A ver =3D ver " " $10=0A print $8 "\t" ver "\t" $= 4 "\t" $5 "\t" $2 "\t" $3 "\t" $7 "\t" lib=0A}' | sort |uniq=0A}=0A=0A# all= symbol info=0Asyms $M/libc.so >$D/so_syms_musl=0Awhile read lib=0Ado=0A sy= ms $G/$lib=0Adone <$D/so_syms_glibc=0Alibanl.so.1=0Alibc.so.6= =0Alibcidn.so.1=0Alibcrypt.so.1=0Alibdl.so.2=0Alibm.so.6=0Alibnsl.so.1=0Ali= bnss_compat.so.2=0Alibnss_dns.so.2=0Alibnss_files.so.2=0Alibnss_hesiod.so.2= =0Alibnss_nis.so.2=0Alibnss_nisplus.so.2=0Alibpthread.so.0=0Alibresolv.so.2= =0Alibrt.so.1=0Alibutil.so.1=0AEOF=0A=0A# symbol name only=0Aawk -F'\t' '{p= rint $1}' $D/so_syms_glibc |uniq >$D/so_syms_glibc_1=0Aawk -F'\t' '{print $= 1}' $D/so_syms_musl |uniq >$D/so_syms_musl_1=0A=0A# difference between musl= and glibc symbols=0Adiff $D/so_syms_glibc_1 $D/so_syms_musl_1 >$D/so_syms_= 1.diff=0Ased -n '/^< /s/< //p' $D/so_syms_1.diff >$D/so_syms_glibc_1_extra= =0Ased -n '/^> /s/> //p' $D/so_syms_1.diff >$D/so_syms_musl_1_extra=0A=0A# = select symbol info of extra symbols only=0Aselsym() {=0A awk -v syms=3D$1 '= =0ABEGIN {=0A while (getline < syms =3D=3D 1)=0A a[$1] =3D a[$1] $0 "\n"= =0A}=0A{printf("%s",a[$1])}=0A' $2=0A}=0Aselsym $D/so_syms_glibc $D/so_syms= _glibc_1_extra >$D/so_syms_glibc_extra=0Aselsym $D/so_syms_musl $D/so_syms_= musl_1_extra >$D/so_syms_musl_extra=0A --hQiwHBbRI9kgIhsi--