[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Mon May 17 14:13:03 CEST 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/05/17 14:13:03

Modified files:
	cm3/m3-sys/m3cc/gcc/gcc/m3cg/: parse.c 

Log message:
	Only export exported functions.
	And really, I'd like to stop referencing non-imported functions
	via GOT, but I can't get it to work.
	
	Work on: Don't export everthing from shared objects.
	Ideally -- only stuff in *.i3 files, and with "Interface" not "interface".
	Work on: Don't go through PLT/GOT for stuff defined in same module (which
	includes stuff exported or not).
	
	Linux/x86:
	before:
	jay at xlin2:~$ readelf -s /cm3/lib/libm3core.so | grep -i expand |wc -l
	18
	jay at xlin2:~$ readelf -s /cm3/lib/libm3core.so | grep -v UND |wc -l
	4564
	
	after:
	jay at xlin2:~$ readelf -s /cm3/lib/libm3core.so | grep -i expand |wc -l
	9
	jay at xlin2:~$ readelf -s /cm3/lib/libm3core.so | grep -v UND |wc -l
	4218
	
	(everything is listed twice, it turns out)
	
	("expand" I just happen to know is often part of unexported function names,
	when there are home-grown growable arrays present)
	
	MacOSX/x86:
	
	before:
	jbook2:m3cg jay$ otool -Tv /cm3.x86/lib/libm3core.dylib  | wc -l
	1852
	jbook2:m3cg jay$ otool -Tv /cm3.x86/lib/libm3core.dylib  | grep -i expand | wc -l
	9
	
	after:
	
	jbook2:m3cg jay$ otool -Tv /cm3.x86/lib/libm3core.dylib  | grep -i expand
	jbook2:m3cg jay$ otool -Tv /cm3.x86/lib/libm3core.dylib  | wc -l
	1506
	
	There is possibly more to be done here, but this is a good start.
	
	Gcc doesn't seem to support what we want, unless we communicate more information
	around that we have, and even then I'm not sure.
	
	In particular, anything in the same shared object, we don't want to refer
	to via the GOT/PLT. We don't compile "shared objects" though, we compile
	individual source files, without knowledge as to what other source files they
	will be linked to.
	
	see (from me):
	http://gcc.gnu.org/ml/gcc-help/2010-05/msg00148.html
	
	(more useful:
	readelf -s /cm3/lib/libm3core.so | grep -v UND | grep GLOBAL  | awk '{print $8}' | sort |uniq |wc -l
	)




More information about the M3commit mailing list