Skip to content
Tcl Source Code Artifact [c91a767af1]
Login

Artifact [c91a767af1]

Artifact c91a767af1eaf77d48cbe02d42464427c79e675963f5f956cd207beecdffb329:

Ticket change [c91a767af1] - Ticket [113be1991e726247|113be1991e] <i>zipfs on mac</i> status still Open with 4 other changes by marc_culler on 2021-01-30 17:41:59.
D 2021-01-30T17:41:59.177
J icomment Appending\sa\szip\sfile\sto\sa\smach-O\sbinary\scorrupts\sthe\smach-O\sbinary.\r\nThis\sis\sbecause\sa\smach-O\sbinary\shas\sstructure.\s\sIt\shas\sa\sheader\sfollowed\r\nby\sa\ssequence\sof\sload\scommands.\s\sSome\sload\scommands\sdefine\ssegments,\r\nsuch\sas\s__TEXT\sor\s__DATA.\sSome\sload\scommands\sdefine\ssections\swithin\r\nthose\ssegments.\s\sThe\sload\scommand\swhich\sdefines\sa\ssegment\sspecifies\r\nthe\soffset\sand\ssize\sof\sthe\ssegment\swithin\sthe\sfile\sand\swithin\sthe\r\nvirtual\simage\safter\sloading.\sThe\slast\ssegment\sis\sthe\s__LINKEDIT\ssegment,\r\nwhich\sis\sreserved\sfor\suse\sby\sthe\sdynamic\slinker.\sIn\sthe\sbinary\sfile\sthis\r\nsegment\sis\srequired\sto\sextend\sto\sthe\send\sof\sthe\sfile.\s\sThis\sis\sno\slonger\r\nthe\scase\safter\syou\sappend\sdata\sto\sthe\send\sof\sthe\sbinary.\r\n\r\nIt\sis\spossible\sto\sadjust\sthe\sload\scommands\sin\sthe\sbinary\sso\sthat\sthe\r\nextra\sdata\sbecomes\spart\sof\sthe\s__LINKEDIT\ssegment,\sand\sappears\sto\sthe\r\nloader\sas\sif\sit\swere\spart\sof\sthe\sstring\stable\sin\sthe\sLC_SYMTAB\ssection\r\nof\sthe\s__LINKEDIT\ssegment.\s\sI\sam\sattaching\sa\spython\sscript\swhich\sdoes\r\nthat,\susing\sthe\spypi\spackage\smacholib.\sIt\sis\snamed\sfix_macho.\r\n\r\nIf\syou\sbuild\sthe\shello\sworld\sexample\sas\sdescribed\sin\sTIP\s#430\sand\srun\r\n$\s./fix_macho\shello\r\nyou\swill\sget\sa\ssingle\sfile\sexecutable\swhich\sruns\sand\swhich\salso\scan\sbe\r\nprocessed\sby\sinstall_name_tool\swith\sno\serrors\s--\sthe\s@bll\stest\spasses.\r\n\r\nNOTE:\sBuilding\sa\s"single\sfile\sexecutable"\sfor\smacOS\susing\sthe\srecipe\sin\r\nthe\sTIP\sis\sa\s**truly\spointless\sexercise**.\s\sThe\sexecutable\sthat\syou\sget\r\nneeds\sto\sload\sthe\sshared\slibrary\s/Library/Frameworks/Tcl.framework/Tcl.\r\nIf\sthat\sshared\slibrary\sexists,\sthen\syou\scould\ssimply\srun\sthe\sTcl\sscript\r\nwith\stclsh.\s\sIf\sit\sdoes\snot\sexist\sthen\sthe\sexecutable\sis\suseless.\sIt\r\nwill\scrash\sbecause\sit\scannot\sload\sthe\sshared\slibrary\sthat\sit\sdepends\r\nupon.
J login marc_culler
J mimetype text/plain
J username Marc\sCuller
K 113be1991e7262479a1843f3924540d7a08d8a88
U marc_culler
Z d317167b983d152fa52b75574bc1d918