








			 The Linux GCC HOWTOĶV0.2

		@: Daniel Barlow <dan@detached.demon.co.uk>

		 Ķ: ؾ(Frank J.S. Chen)<frank63@ms5.hinet.net>

			    v1.17, 28 February 1996



				   Abstract

     ĭzwGNU
     CsĶM{]kAPɷ[a{sĶBsBBL{HΥiୱ{ѦhDCg@ѦҸƮbӦ۩Mitch
     D'SouzaͩҦGCC-FAQFӥt@ӨӷOELF-
     HOWTOCHOWTOiHwNFGCC-FAQAӥBYNnä[NELF-
     HOWTOFC DGCC-
     HOWTOĤ@}o檺]z|ǸFORCSǧ@^APĳAHwC



1.  滷I

1.1  Ķ̪

    oĶ嬰Linux document pro
     jects(LDP)½ĶpetC@Cثe}http://www.linux.org.tw/CLDP/AwUͿDJ@peC

    ڨèSӭvr½ĶCFODĶqZiŪAڷ|yyդ@rA[oKLAάO²Fo˰ܡAiHɤ^嶡ykctʡAByiHeqLêC

    @rPM~JA|[WrC

    JĶxA߭`rJpbugsBshadow passwordBpaddingBim
     ageAhOd夣ܡCYդUoǦrJAĶ㪺AФ[СC

    夤YJ"[Ķ̵:**]"аOAhHB~ѡC

    ogĶ妳ĳPðݪAemailfrank63@ms5.hinet.netC

    WWW Home PageG http://linux.ntcic.edu.tw/~jsfrank/C

    Ķ½Ķvwo^y@Daniel Barlow
     ͤPNFtAؾͫOĶҦvQAAiHNAHUشC鴲GoĶAߦ`ɥRݭʤʪWABiNĶC

    v0.1Ķ۷WAsyykcӹLPAv0.2w襤媺ΦrߺDӭץAñNW@ĶaץLӡAҦpei
     theroӦrA^H`ei
     therWΡA̤N@ӡFoHOWTONRXoӥΦrߩʡAy򥻤WtC

    夤XyܨSĶXӡA@譱OݤAt譱OĶ]ĶXӡAҥHunOdFAnOդUs⮩ALצpЧiDڡC

    v0.1½Ķ_lG11/7/97FIG11/19/97C



The Linux GCC HOWTOĶV0.2						      1





The Linux GCC HOWTOĶV0.2						      2



    v0.2ץ_lG5/13/98FIG6/3/98C

1.2  ʻPR


 "

ثeLinuxoiiܬ骺iۡC²@IALinuxذɪ榡iΡAMAtάOX_ӪFALin
uxӬO䤤@اaI\ŪoAiHUAMɪOC



npϧOOH椽ε{file]ҦpAfile
/bin/bash^NFCNELF{ӨAùWܥXӪT|tELFrFpGOa.outAT|㦳
Linux/i386rˡC

ELFPa.out榡tB|b򪺳`Qס]ܼsxI^CELFOs榡A@ӨA{׸ΡC

1.3  @̪py

 "

 vPXkwWwAN\bo󪺧ݡC~A٦@ǤoAܭnCNAۨSƷFA]nbUsenetW@ǧbʰݪDF٦AnѥHۤvCy\O`pAMo@ǤObugsbugsXӥH{AoNiDOHAǵLNAbѷݭeAjMFܡHҥHۥHO^DqOovC

1.4  LPƪ

 pGA{bŪOPostscriptBdviάOhtml榡AAҬݨ쪺rܤƴN|uŪ¤r榡Hh@ǡCSOOɮצW١BROBROXPKXӪlXAβγOrrCo˰ܡAYǻݭnjժܼơ٦ǨSTwGdҦӨANiHFjժĪGFC

Ūo󪺦PɡAA]|o@MZΪޡCYOdviB
postscriptAުƦrNO`(sec
tion)sFpGOHTMLܡAoǼƦr|ǱƦCAAiHηƹhs۹諸ޤeFpGAݪO¤r,
ƦrNuOƦrASOtNFĳA֪@ŬI

ڥΪshellOBourne shell]OC shell^A|Ҥl۵MOBourne
shellykCpGAΪOC shellܡA]wܼƪyk|UoˡG

     % setenv FOO bar

nOBourne shellܡAڷ|oˤlgG

     $ FOO=bar; export FOO

pGܲŸܪOrŸ#ӤOrŸ
$ܡAܦioөROOuAΩrootӤwCMաAnOAդFoǽdҡAG˱oAtεoͨaܡAڥiO@Id]|tInBI:-)

11/8/97Ķ.  5/13/98׭q


2.  FFbH

2.1  GCC-HOWTObH

 oOLinux HOWTOtC@AyܻAAiHbҦsLinux
HOWTO󪺺WoܡAҦp<URL:http://sun








The Linux GCC HOWTOĶV0.2						      3



site.unc.edu/pub/linux/docs/HOWTO/>CHTML]i|Os^iHq<URL:http://ftp.linux.org.uk/~bar
low/howto/gcc-howto.html>WUӡC

2.2  GCCƤSbH

 "

зǪgccOHbo檺lX(source distribu
tion)]UݴNFI^AYtex
tinfoP.infoɮסCnOAstv֡AάO@cdromAMAת@ߤ]AAiHۤv⥦untarAMA۹줸@@/usr/infoؿUCpAPWzšA
tsx-111 Wh[[CLAڷQASnѬO}O۳̷saI



 libc󻡩بӷC@جOGNU libcAH.info榡xsAFst
dio~AlLinux
libc۷ԺɺTCt@إiHbLinuxarchivemanpages2
WtΩIs]system call^]2`^Plibcơ]func
tion^]3`^󻡩C

2.3  GCC

ѵG:

(a)AiHb<URL:ftp://tsx-11.mit.edu:/pub/linux/packages/GCC/>W
Linux GCCot(distribu
tion)AӥBOwgsĶniɡCڦbgoɡA2.7.2(gcc-2.7.2.bin.tar.gz)O̷sC

(b)ۥѳn|]Free Software Foundation^ҵoGGCC̷slXiHqGNU
archives3
WoCSnDoPWz@P~ALoӪTOثe̷sCLinux
GCC@(maintainers)AiHܻPۦsĶoӳ̷sCconfigureROZ(script)|A۰ʳ]wnҦӰƱCĳAŤtsx-114
ݬݡAw|ץOA|QnΪC

pGQnsgX@ǦΪn]OoA٬O֨Sԣγ~nbW|By«C^AUo@p`ҽͪ]OAݭnG

2.4  C{]PY

 "

ӿ@M{]OM(i)AtάOELFάOa.outF(ii)AƱAtܦ@ءHpGAOqlibc
4@Ũlibc
5A򵹧A@Ө}ߪĳAhݬELF-HOWTOACA@w|ݡAbELF󪺭OHKIKIʡANthoۦPmCtsx-115
WiHAQnC

      libc-5.2.18.bin.tar.gz
	    --- ELF@ɵ{]]ELF shared library images^ARA{]]static
	    libraries^PYɡ]wCyPƾǵ{]^C

      libc-5.2.18.tar.gz
	    ---libc-5.2.18.bin.tar.gzlXCoɮקA]ݭnA].bin.M(pack
	    age)tݪYɡCpGɧASݤMAoOѨ˦ۤUAʤsĶC{wnF٬OΤHasĶnGi(bina
	    ries)NiHFCoاxZHAӡAݧڪLΡGΤHasĶnGiɤNѨMFIubAQnNYSάOshadow
	    passwordpUA~ݭnۤvӱʷnxC

      libc-4.7.5.bin.tar.gz
	    --- oɮ׬Oa.out@ɵ{w(shared library
	    images)PRA{wAγ~OFPezlibc
	    5M@s@aӳ]pALDAQn~ϥa.out{άO~oia.out{AMܡAOݭnC



The Linux GCC HOWTOĶV0.2						      4



2.5  pu (as, ld, ar, strings etc)




 "

ثeAPeҽͪ@ˡAqtsx-116
WANiHoǤu{CثeObinutils-2.6.0.2.bin.tar.gzC

ݭn`NObinu
tilsuAΩELFAӥBثelibc]OݩELFFMաAߺDa.outHpGELFlibcPa.outlibcpX_Ӥ@_ϥΡAoL̨OAnLƤFCi_{AC{]oiHM}BڦVELF榡ADAuܦnzѡAݭna.outFFAMڡAja|yAi}AX[JUiתjyC

11/9/97Ķ


3.  GCCw˻PGCC]w

3.1  GCC



 "

bshellܲŸUJgcc
-vAùWN|ܥXAثebϥΪGCCCPɳo]O@Ӭ۷iakAiHTwA{bҥΪOELFάOa.outCbڪtΤWAgcc
-vGOG

     $ gcc -v
     Reading specs from /usr/lib/gcc-lib/i486-box-linux/2.7.2/specs
     gcc version 2.7.2

WTXFX󭫭nƱG

     i486
     oOA{bbΪgccOF486LBzӼg---AqiO386άO586Co3طLBzҽsĶӦ{XAOiHۮeϥΪCtOBO486{XbYǦa観[Wpadding\AҥHiHb486W]o֡Co386ӨA{įä|򤣨}vTAuLu|{XܱoyyjF@ǡC

     box oiH@I]nFL]itҫ]OslackwareΪ̬Ode
     bian^AΪ̮ڥ]O]ҥHoI㪺ؿW٬Oi486-linux^CpAOȬ˳˳̡A˦۰ʤإݩۤvgccAAiHbإߪL{]wo@AHICNڰ@:-)C



____________________

1. <URL:ftp://tsx-11.mit.edu:/pub/linux/packages/GCC/>

2. <URL:ftp://sunsite.unc.edu/pub/Linux/docs/>

3. <URL:ftp://prep.ai.mit.edu/pub/gnu/>

4. <URL:ftp://tsx-11.mit.edu:/pub/linux/packages/GCC/>

5. <URL:ftp://tsx-11.mit.edu:/pub/linux/packages/GCC/>

6. <URL:ftp://tsx-11.mit.edu:/pub/linux/packages/GCC/>







The Linux GCC HOWTOĶV0.2						      5



     linux oOlinuxelfάOlin
     uxaoutCo@|OHް_nxbAsO@ط|ھڧAҥΪӲC


	  linux
	  NELFYǸO2.7.0.]άOs^F_hܡANOa.outFC

	 linuxaout Na.out榡Clinuxwqqa.out󴫨ELFɡAlin
	  uxaoutN|An@ܡAF@ӥؼЪC]AA|ݨ󪩥s2.7.0.gcclin
	  uxaoutC



	 linuxelf
	  wgLɤFCq`oO2.6.3gccAӥBoӪ]iHΨӲELFiɡCn`NOAgcc
	  2.6.3bELF{Xɷ|bugsAҥHpGAثeΪnOoӪAĳA֪@šC

     2.7.2 ǸC

ҥHA`_ӡAڦ2.7.2gccAiHELF榡{XCNo²AYaIehH

3.2  FF˦n᳣hF?

pGwgccɨSJӪݵۿùAΪ̧AOq@ӧ㪺otθ̧gccWXӦw˪ܡA]\A|QD쩳oǪFF˦nObɮרtΪǦaCXӭIpUG

    /usr/lib/gcc-lib/target/version/
     ]Plؿ^jsĶNOboӦa誺Cbo঳i檺{AڦbsĶu@Ft~A٦@ǯSw{wPYɵ]|xsbC

     /usr/bin/gcc OsĶXʵ{---]NOAڦbROC(command
     line)W檺{CoӥؿiѦUتgccϥΡAunAΤPsĶؿ]pWҭz^Ӧw˴NiHFCnDwO@ӡAbshellܲŸUgcc
     -vCnOQjYӪANgcc -V versionCҦpG


	  # gcc -v
	  Reading specs from /usr/lib/gcc-lib/i486-box-linux/2.7.2/specs
	  gcc version 2.7.2
	  # gcc -V 2.6.3 -v
	  Reading specs from /usr/lib/gcc-lib/i486-box-linux/2.6.3/specs
	  gcc driver version 2.7.2 executing gcc version 2.6.3



     /usr/target/(bin|lib|include)/
     pGAˤFƺتؼЪAҦpa.outPelfAάOY@تesĶ(cross-
     compiler)AݩDDyؼЪ]non-native tar
     get(s)^{wAbinu
     tils]asBld^uPYɵiHboCYϧAuwˤF@gccA٬OiHbooǭ쥻NO̷ǳƪFFCpGOboANӬOb/usr/(bin|lib|include)FC


     /lib/A/usr/lib P䥦ؿODytΡ]native-sys
     tem^{]ؿC\hε{|Ψ/lib/cppA]A]ݭn---@kWAOq/usr/lib/gcc-
     lib/target/version/ ؿ̫ANO˭ӲŸs]symlink^VC
     [Ķ̵:ҿתnativeAOثeAtάOHa.outelf榡DAΪ̤wgccO@تCna
     tiveNOgBꪺPѥͪKKFA@CD-








The Linux GCC HOWTOĶV0.2						      6



     ROMYܧNLinuxw˧ALinuxX͡AAӤHS@p@~xApGA[ˤ@Ǥ@˪ؼЪA۵MNgP~١}
     LFv~AꡦP~ꡦBѥ͡PHϧOAPɤ]tw]default^NbCYA[WAӤH[P_MߦnAڷQΥDy]native^PDDy]non-
     native^½ĶٺC]



3.3  Yɣz?Yɣz?

 "

pAۦw˦b/usr/local/includeؿUYɱưb~ܡALin
ux٦t~3إDnYɡG

   
     /usr/include/PlؿUYɡAjOH.J.LuoilibcM(libc
     binary pack
     age)ҴѪCڷ|uj]AO]Ai঳䥦ӷYɡ]OcursesPdbm{w^\boFרOApGA{bΪO̷slibcotΪܡ]sªˡAwgA䴩cursesdbmFC^AFFhOHHQުI
     [Ķ̵:libc binary packageNHGiΦ(machine
     code)xsMAëDlX]text^AYnHĶXAhlibcGiɮM󡦡AmAGhbi
     naryAHlibcMq١C]




     b֤߭lXotΤ(kernel source distribution) A/usr/include/linux
     P /usr/include/asm ]YoɮסG<linux/*.h> P
     <asm/*.h>^ӦŸs]symbolic
     links^iHsܥؿlinux/include/linux P
     linux/include/asmCpGAE[ӪܡAw˳oǪFFANӥuOӽsĶ֤ߡ]ker
     nel^ӤwC

     lXY]unpacking^AiA]|o{Aݭnb֤ߪؿ]kernel
     directory^Umake configʧ@Cܦhɮ׳|̿<linux/auto
     conf.h>AiOoɮ׫oi]PӤsbCYz֤ߪ̡AasmNuOۤv@ӲŸsAȶȬObmake
     configɤ~إߥXӦӤwC [Ķ̵:崣autoconf.hɬOMany files depend
     on <linux/autoconf.h>,which otherwise may not exist,*CBother
     wiseήe(adj)At@pBt@ءBPNANήely}G(i)
     Many files depend on <linux/autoconf.h>.  (ii)<linux/autoconf.h> of other
     condition may not exist.
     PU@yۤABPbPpUC]

     ҥHAAbؿ/usr/src/linuxUAѶ}֤ߪ{XɡANӵۤUܪaI


	  $ cd /usr/src/linux
	  $ su
	  # make config
	  (^UӪDCq`^oTänADA~vy֤ߡC)
	  # cd /usr/include
	  # ln -s ../src/linux/include/linux .
	  # ln -s ../src/linux/include/asm .











The Linux GCC HOWTOĶV0.2						      7



     Ѧp<float.h>B<limits.h>B<varargs.h>B<stdarg.h> P<std
     def.h>ɮסA|HۤPsĶӲAݩAӤHɮסAiHb
     /usr/lib/gcc-lib/i486-box-
     linux/2.7.2/include/P䥦]ۦP^ؿW٪aC

     11/11/97Ķ 5/14/98ץ

3.4  إߥesĶ(Building cross compilers)

3.4.1  NLinux@Ъ@~x(target platform)

 ]AwggcclXAq`Aun̴`INSTALLɪܫKi@]wC
make᭱Aconfigure --target=i486-linux --host=XXX on platform
XXXANAܧFCn`NOAA|ݭnLin
ux٦֤ߪYɡFPɤ]ݭnإߥeĶ(cross assembler)Pes(cross
linker)AӷO<URL:ftp://tsx-11.mit.edu/pub/linux/packages/GCC/>C

3.4.2  Linuxl@~x(source platform)MSDOS@Ъ@~x

 UghCܩ㪺AoӤjݭnΨMemxάOMgoCЦۦh<URL:ftp://sun
site.unc.edu/pub/Linux/devel/msdos>ݬݡCڨèSչLoǭӪFAҥHSkOҤC


4.  ӵ{PsĶ{

4.1  gccۦwqŸ

 "

ungccɡA[
-voӰѼơANXAҥΪogccA۰AwqFŸCҦpAڪݰ_ӷ|oˡG

     $ echo 'main(){printf("hello world\n");}' | gcc -E -v -
     Reading specs from /usr/lib/gcc-lib/i486-box-linux/2.7.2/specs
     gcc version 2.7.2
      /usr/lib/gcc-lib/i486-box-linux/2.7.2/cpp -lang-c -v -undef
     -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -Dunix -Di386 -Dlinux
     -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386
     -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386)
     -Amachine(i386) -D__i486__ -

YAbg{X|Ψ@LinuxWSʡA⨺ǵLkӪ{XAH󦡽sĶemROʬA_ӡAiOӤDNOIpUҥܡJ

     #ifdef __linux__
     /* ... funky stuff ... */
     #endif /* linux */

__linux__NiHFتFݥJӤ@IAOlinuxClinux]wqAAoӤMOPOSIXзǡC

4.2  uWDU

 gccsĶѼƪOgcc info page]bEmacsAUC-h
iAMgccﶵ^CnOˤXӡAOACD-
ROMHSoӪFFAAMNOA{bΪOªCJoرpA̦nkOʴLvarchive<URL:ftp://prep.ai.mit.edu/pub/gnu>άOmir








The Linux GCC HOWTOĶV0.2						      8



rorsxAhgcclɮק^aAsi@fC

gcc manual page]gcc.1^
iHOwgLɤFAnOAYFۨSƷFwOQݡAN|iDAOLFC

4.2.1  X~


 "

 bROCWgccɡAunbѫ᭱[W-
OnﶵANgccĨĪAͥX̨νsXXCo̪nO@ӥiiLpơAPgccAnNqP䥿T\ĳ@ˡALA嫬dOq0]nCAڤn̨νsXC^ܤƨ2]̨νsXnh@IC^AA@Ũ3]̨νsXnAh@IAh@I^C

gccb䤺|NoǼƦrĶ@tC-fP-mﶵCgccɱaWX-vP-
QAANܲMݥXC@صŪ-OO쨺ǿﶵCn񻡡AN-
O2AڪgcciD|ڻG

     enabled: -fdefer-pop -fcse-follow-jumps -fcse-skip-blocks
     -fexpensive-optimizations
	      -fthread-jumps -fpeephole -fforce-mem -ffunction-cse -finline
	      -fcaller-saves -fpcc-struct-return -frerun-cse-after-loop
	      -fcommon -fgnu-linker -m80387 -mhard-float -mno-soft-float
	      -mno-386 -m486 -mieee-fp -mfp-ret-in-387

nOAΪ̨νsXŰAsĶү䴩]e.g.
-O6^A򥦪ĪGNAΧAsĶүണѪ̰ŪĪGO@˪CbAoXhgcc{XAΦbsĶɳOpBzoDAuOncQCYOiB̨νsXkXs̡AӧA]άOAusers^٬Oյ۳o˰ܡAiN|o{gcc|_A{FC


qgcc 2.7.0@Ũ2.7.2usersӪ`N@IAϥ-
O2ɷ|@bugCV|OAjקѼ(strength reduc
tion)~MSΡInOAwssĶgccܡAO@ӭץiH󥿳o~FMܡA@wnTwCsĶɳ[W-
fno-strength-reduceI

11/12/97Ķ

4.2.1.1  өʪLBz

 @-
mXQγBAOoLkǥѦUصŪ-O}ӨϥΡCo̭nO-
m386M-
m486oءAΨӧiDgccӧ⥿bsĶ{X@M386άO486ҼgC׬Oέ@-
mӽsĶ{XAiHbWA-
m486sĶXӪX|jALӦb386W]]|CNOFC

ثe|L-mpentiumάO-m586XCLinusĳڭ̥iH-m486 -malign-loops=2
-malign-jumps=2 -malign-func
tions=2ӱǫνsX486{XAo˰nNiHקKalignment]Pen
tiumäݭn^Ljgapso͡CMichael MeissnerG














The Linux GCC HOWTOĶV0.2						      9



     ڪĤPiDڡA-mno-strength-
     reduce]KInoڥiObͱjקѼƪbugrAwgOt~@ӪתԳFC^@ˤ]iHbx86W͸֪{XAoO]x86ȦsۤiiȴbAӥBGCC's
     method of grouping registers into spill registers vs. other registers
     doesn't help
     eitherCǲΤWAjקG|ϱosĶhQΥ[kȦsH[kBӨNkBCƹWAڦbh-
     fcaller-savesi]uOӺ|}]wC



     ӧڪĤCPhAתiDڻA-fomit-frame-
     pointeri|]iण|YCqoIӬݡANON׵ۦt@ӼȦsiHΨӳBzOtDCt譱AYºqx86bഫOXkWӬݡAKN׵۰|ҥΨ쪺OŶnframeҥΨ쪺٭nӱohFyܻAIcache{XӨèSWUAYOդUΤF-
     fomit-frame-
     pointerܡAPɤ]OiDsĶbCIsƤANץ|СFMӡANframeAYIsƤhܡAh\|Ȯɰn_ӡC

o譱DD̫@qܤOӦ۩LinusG

     n`NOApGAQnǫΪpįAidUO۫HڪܡCLצpA@wniաCgccsĶ٦\hѼƥiΡA䤤iN@س̯SOզXAiHĄνsXGC

11/14/97Ķ 5/15/98ץ

4.2.2  Internal compiler error: cc1 got fatal signal 11





 "

 Signal 11O SIGSEGVAΪ segmentation violationCq`oO
gccۤvҥΪзPxbAӥBٹյۧƼgJݩ󥦪O̡CҥHAoiO@gccbugC
MӡAjӨAgccO@gLYKեBiaר}nnΧ@C]ΤFjqƵcPHмƶqC²AYOn糧@̬DP̤@ARAMյ{AgcciH@KZaCpALksƻsobug---As}lsĶɡA~TèS@X{bP@Ӧa---XGiHTw,OAw饻D(CPU,O,DOάO֨O).dUn]AqiHqL}{ǪաBάOWin
dowsiH]oܶBΪ̨䥦򪺡AN^LYӤjvŶǻoOgcc@bugFAҰoǴհʧ@Aq`SڤWȡAoOܦXzסCt~A]n]sĶ֤߮ɡA`Odbmake
zImageqANnj|oOgccbug---M|bڡImake zIm
ageɡAݭnsĶɮץiNWL200ɮסFڭ̥b@ӴNסC

 pGAiHвͳobugAӥB]̦nOo˰աI^iHg@ӵup{ӮiܳobugܡAANiH⥦bugiAMemailFSFAΪ̬Olinux-
gccqH׾¡CAiHhѦgccAݬݦԲӪT,OL̩һݭnC

4.3  ӯO

 ڳAӳ\hXAYOYFF{b٨SӨLinuxWhAiH֩wOA@w@IȤ]SC:-)

Ig@IC@ӨAlXuݭn@ǧקANiHJALinux
100%PPOSIXۮeSCpGAF󪺭קAӱNǦ^@̡A|Oܦس]ʪ|ʡCoˤNuݭnΨ졥makeANo@ӥi檺ɮפFC

4.3.1  BSDЮ{ ( bsd_ioctlBdaemon P <sgtty.h>)

 sĶ{ɡAiHtX-I/usr/include/bsdPs-lbsd{wC]ҦpGbAMake
fileɤA-I/usr/include/bsd[CFLAGS@F-lbsd[LD
FLAGS@^CpGAuQnBSDAH欰A]ݭnA[W-
D__USE_BSD_SIGNALFCO]AΤF-I/usr/include/bsdPtAFY<sig
nal.h>AmakeɴN|۰ʥ[JFC










The Linux GCC HOWTOĶV0.2						     10



4.3.2  ʦL

(SIGBUS, SIGEMT, SIGIOT, SIGTRAP, SIGSYS etc)




 "

 LinuxPPOSIXOۮeCLAǫHäOPOSIXwq---ISO/IEC
9945-1:1990 (IEEE Std 1003.1-1990), paragraph B.3.3.1.1 sez:

     bPOSIX.1ٲFSIGBUSBSIGEMTBSIGIOTBSIG
     TRAPPSIGSYSHAO]̪欰P@覡AӥB]LkiACT{@覡AKiHoeoǫHAiOH󻡩̬Ob˪ҩUoeXӪAHΫXP̪oiC

QnץoӰDA²]O̲ªkNOSI
GUNUSEDswqoǫHCTkӬOH󦡪sĶ#ifdefӳBzoǰD~G

     #ifdef SIGSYS
     /* ... non-posix SIGSYS code here .... */
     #endif

11/15/97Ķ 5/22/98ץ

4.3.3  K & R

gccO@ӻPANSIۮesĶF_ǪOAثejhƪ{XŦXANSIҩwзǡCpGARANSIAwANSIѪзǨӼgC{AGF[W-
traditionalX~ANS䥦iHhͪFCThere is a certain amount of
finer-grained control over which varieties of brain damage to emu
late;Цۦd\gcc info pageC

n`NOAާAΤF-tradi
tionalӧܻySʡAĪG]ȫ]gccүdCҦp, -tradi
tional|}-fwritable-
stringsAϱor`ƲܸưOŶ(q{XOŶXӡAoӦaONgJ)Co˰|{XOŶLΤW[C

4.3.4  emBzŸfWƭ쫬ŧi


 "

̱`DOApҬҪALinux\h`ΪƳwqsbYɤAɭYۦƭ쫬ŧiX{b{XAemBz|ڵiykRem@~C`atoi()Patol()C

4.3.5  sprintf()

 "

bjUnixtΤWAsprintf(string, fmt,
...)Ǧ^OstringСAMӡAo譱Linux]`ANSI^Ǧ^oOJstringrƥ.i沾ӮɡAרOwSunOSAݦĵıߡC

4.3.6  fcntl PơFFD_*aڪwq쩳¦b?











The Linux GCC HOWTOĶV0.2						     11



 "

Nb<sys/time.h>YC Fu쫬ŧiAAΤFfc
ntlAiA]QtAY<unistd.h>iӡC

@ӨAƪmanual page|bSYNOPSIS`CXݭnYɡC

4.3.7  select()p---{ɷ|B󦣸L-ݪA

 "

ܤ[ܤ[He,Aselect()pɰѼƥuŪʦӤwCYϨF̪Amanual
pagesMUoqĵiG

     select()ӬOǥѭץɶƭȡ]pGܡ^AAǦ^ۭlpɶ}lҳѾlɶCӪi|ϳo\{C]ANثeӨAYHIsse
     lect()ApɫФM|QץLAiO@ثD`QkI

ӴNbڭ̪eFIܤ֡AboAiHݨCse
lect()Ǧ^AOݩ|FƩүӶOɶAѾlɶƭȡCpGbpɵɡASƶǰeiӡApɤ޼ƫK|]0FpG٦select()AHP˪pstruc
tureөIsAselect()K|ߨ赲C

YnץoDAunCIsselect()eApɼƭȩp struc
tureANSDFCU{XA

	   struct timeval timeout;
	   timeout.tv_sec = 1; timeout.tv_usec = 0;
	   while (some_condition)
		 select(n,readfds,writefds,exceptfds,&timeout);


令A

	   struct timeval timeout;
	   while (some_condition) {
		 timeout.tv_sec = 1; timeout.tv_usec = 0;
		 select(n,readfds,writefds,exceptfds,&timeout);
	   }

oӰDAbǪMosaic̬O۷ۦWAun@ݡAMo
saicNb̤FCMo
saicùkWAOOӶꪺB|઺ayʵeCyoU֡ANܸƱqWǰeLӪtvUCI

4.3.8  ͤ_tΩIs


 "

4.3.8.1  SxG

@{HCtrl-ZBMAsɡXΪ̬O䥦iHCtrl-
C_HpApl{Ǫ׵XtδN|軡"interrupted system
call"άO"write: unknown error"AΪ̽ѦpTC










The Linux GCC HOWTOĶV0.2						     12



4.3.8.2  DIG

POSIXtˬdHơA_@ªUnixOnh@ICpGOLinuxAiN|sig
nal handlersFX

     DPBa(pɾwn)

     tΩIsǦ^

     bUCtΩIsJ select(), pause(), connect(),accept(), read()
     on terminals, sockets, pipes or files in /proc, write() on terminals,
     sockets, pipes or the line printer, open() on FIFOs, PTYs or serial
     lines,ioctl() on terminals, fcntl() with command F_SETLKW, wait4(), sys
     log(), any TCP or NFS operations.

N䥦@~tΦӨAAݭniNOUoǨtΩIsFG creat(), close(),
getmsg(), putmsg(), msgrcv(), msgsnd(), recv(), send(), wait(), waitpid(),
wait3(), tcdrain(), sigpause(), semop() to this list.

btΩIsAY@H]{ǳƦnhandler]F^͡Ahan
dlerN|QIsChan
dlerNvಾ^tΩIsɡA|Xwgͤ_AӥBǦ^ȷ|ߨ]w-1Aer
rno]wEINTRC{èSQ|oͳoبơAҥHNFC

حץkiHܡG

(1) CӧAۦw˪signal handlerAbsigac
tionX[WSA_RESTARTCҦpAUC{A

       signal (sig_nr, my_signal_handler);


令A

       signal (sig_nr, my_signal_handler);
       { struct sigaction sa;
	 sigaction (sig_nr, (struct sigaction *)0, &sa);
     #ifdef SA_RESTART
	 sa.sa_flags |= SA_RESTART;
     #endif
     #ifdef SA_INTERRUPT
	 sa.sa_flags &= ~ SA_INTERRUPT;
     #endif
	 sigaction (sig_nr, &sa, (struct sigaction *)0);
       }

n`NOAoܧjqΨtΩIsAIsread()Bwrite()Bioctl()B
select()B pause() P connect()ɡAAMoۦˬdEINTRCpUҥܡG

(2) AۤvoܩTaˬdEINTRG

o̦Ӱwread()Pioctl()ҤlC

l{qAϥread()G








The Linux GCC HOWTOĶV0.2						     13



     int result;
     while (len > 0) {
       result = read(fd,buffer,len);
       if (result < 0) break;
       buffer += result; len -= result;
     }


ק令,

     int result;
     while (len > 0) {
       result = read(fd,buffer,len);
       if (result < 0) { if (errno != EINTR) break; }
       else { buffer += result; len -= result; }
     }


l{qAϥioctl()G

     int result;
     result = ioctl(fd,cmd,addr);


ק令A

     int result;
     do { result = ioctl(fd,cmd,addr); }
     while ((result == -1) && (errno == EINTR));

`N@IAǪBSD
UnixA䤺w欰OstΩIsCYntΩIs_Aoϥ SV_INTER
RUPTSA_INTERRUPTXC

4.3.9  iHgJr




 "

 gccusers`hۼ[QkA۫HL̥YӦr@`ƨӥή---NuuOr`ƦӤwC]Aoئr`Ʒ|xsb{XOϬqCoϰiHpageϺоimageWAקKӱswapOŶAӥBռgJ|ʳ|y~(seg
mentation fault)CoiO@دSOI

¤@I{ӨAoi|ͤ@ӰDCҦpAIsmk
temp()Aǻ޼(arguments)Or`ơC
mktemp()|յۦb*Am*sgJ޼ơC

ץk~G(a)H-fwritable-
stringssĶAgccN`ƸmbưOŶFΪ(b)NIǦavsgAtm@Ӥ`ƪrAbIseAHstr
cpy()NƫihC











The Linux GCC HOWTOĶV0.2						     14



4.3.10	Isexecl()|ѡH

 "

O]AIs覡Cex
eclĤ@Ӥ޼ƬOAQn檺{W.ĤGӻP򪺤޼Ʒ|ܦAҩIs{argv}CCOGǲΤWAargv[0]Ou{Saۤ޼ưɡA~|]wȡCҥHoAAӳo˼gG

     execl("/bin/ls","ls",NULL);


ӤOuA

     execl("/bin/ls", NULL);

{Ӥa޼ơAiO@ܽШAتO⦹{ʺA{wWߪSʦLXӡCܤ֡Aa.outOo˪CNELFӨCƱNOoˤF.

]pGAQo{wTA@ǧ²檺iΡFѦҰʺAJ@`AάOlddman
ual pageC^

11/16/97Ķ 6/2/98ץ


5.  Pʺ

5.1  wv]lint^

 "

 lintLinuxӨèSܼsxγ~ADnO]jHມgccҴѪĵiTCi̦ΪNO-
WallѼƤF---oӰѼƪγ~OnDgccNҦĵiT{XӡFbut probably has
more mnemonic value if thought of as the thing you bang your head against.

W@ӹΪpublic domain lintA
<URL:ftp://larch.lcs.mit.edu/pub/Larch/lclint>CڨäDoӯ쩳hnNOFC

5.2  

 "

5.2.1  ڭn˰~NT@{YH



 "

 AݭnK[-gѼƨӽsĶPs{AӥBiH-fomit-frame-
pointerѼơCƹWAAݭnssĶҦ{AuݭssĶثeAbYiC

Na.outպAӨA@ɵ{wOH-fomit-frame-
pointersĶӦAoӮɭԡAgdbNܱo^LΪZaFCsɵw-
gﶵAӴNtRAsNqFFoNOn[-g]FC

pGssѡAiDA䤣libg.aANOb/usr/lib/ؿUA֤Flibg.aClibg.aO@CyܯSO{wC@blibcM󤺴N|libg.aFMܡ]sOo˪^AAiݭnlibclXۤv]mFALAڤWAӤݭn~CެOتAjpUAuݱNlibg.as/usr/lib/libc.aAANo쨬TFC









The Linux GCC HOWTOĶV0.2						     15



5.2.1.1  AणⰣTH

 "

ܦhGNUnbsĶsɡA|]w-
gﶵFo˰|yɹLjD]q`ORAs^CڤWAoäO@ӫܼQkC

pG{autoconfAͤFconfigureROZAq`ANiH./configure
CFLAGS=άO./configure CFLAGS=-O2TCMܡAAoˬdˬdMake
fileFCMաApAΪOELFA{K|HʺA覡ӳsA׬O_-g]wF]AiH`ߧ-
gC

5.2.2  Ϊn

 "

AѡAjHOgdbӰCAiHqGNU archive sites7
l{FΪ̬Otsx-118
iɡCxxgdbO@X{AӰgdb]]NOAow˦ngdbA~Axxgdb^CxxgdblXiHb<URL:ftp://ftp.x.org/con
trib/xxgdb-1.08.tar.gz>C

t~AUPS{wRick Slad
keyӦ\CUPSiHbXUoܦnAxxgdb---ȶȬOgdbXeݤ]X
front
end^Co䰣{@ju}SIAӥBpGAoɶh@}ꪺ{AĳAҼ{Ҽ{xxgdbCƥsĶnLinuxPץlXiHb<URL:ftp://sun
site.unc.edu/pub/Linux/devel/debuggers/>Cӳ̪쪺l{hb
<URL:ftp://ftp.x.org/contrib/ups-2.45.2.tar.Z>C

Ai|o{t@ӥΨӰustraceA]O۷ΡCiHܥXѵ{ǩҲͪtΩIsAӥBپ֦䥦hcƪ\AOpGASlXܡAstraceiHAXǸ|W١]path-
names^wsĶiɤF exacerbating race conditions in programs that you
suspect contain
them;٦AstraceiӾǲߵ{Obq檺C̷s]ثeO3.0.8^ib<URL:ftp://ftp.std.com/pub/jrs/>C

5.2.3  I{]`n{^

嫬`n{(daemon pro
grams)Ofork()AMפ{ǡCo˪kϱoɶuFC

AѳoI²檺kNOfork()]@Ӥ_I]break
point^C{ɡAjfork()Ǧ^0C










____________________

7. <URL:ftp://prep.ai.mit.edu/pub/gnu>

8. <URL:ftp://tsx-11.mit.edu/pub/linux/packages/GCC>







The Linux GCC HOWTOĶV0.2						     16



     (gdb) list
     1	     #include <stdio.h>
     2
     3	     main()
     4	     {
     5	       if(fork()==0) printf("child\n");
     6	       else printf("parent\n");
     7	     }
     (gdb) break fork
     Breakpoint 1 at 0x80003b8
     (gdb) run
     Starting program: /home/dan/src/hello/./fork
     Breakpoint 1 at 0x400177c4

     Breakpoint 1, 0x400177c4 in fork ()
     (gdb) return 0
     Make selected stack frame return now? (y or n) y
     #0  0x80004a8 in main ()
	 at fork.c:5
     5	       if(fork()==0) printf("child\n");
     (gdb) next
     Single stepping until exit from function fork,
     which has no line number information.
     child
     7	     }

5.2.4  ֤ɮ

Linux}ɡAq`պA|]wn֤ͮɮסCnOAw̪ܡAiHshellbuiltinROϨ䭫sͮġGNC-
shellۮeshell]ptcsh^ӨA|OUoˡG

     % limit core unlimited


Bourne shellshell]sh, bash, zsh, pdksh^hϥΤUykG

     $ ulimit -c unlimited

pGAQnӦh~h֤ɩRW]core file naming^]for example, if you're
trying to conduct a post-mortem using a debugger that's buggy
itself^AAiHA֤ߵ{@IppʡC@fs/binfmt_aout.cPfs/binfmt_elf.cɤPUC۲Ū{q(in
newer kernels, you'll have to grep around a little in older ones)G

	     memcpy(corefile,"core.",5);
     #if 0
	     memcpy(corefile+5,current->comm,sizeof(current->comm));
     #else
	     corefile[4] = '\0';
     #endif

N01.











The Linux GCC HOWTOĶV0.2						     17



5.3  ʺ

 ʺޡ]Profil
ing^OΨˮ֤@{ǳO̱`IsάO檺ɶ̤[kCo{̨ΤƻPXɮɶOOӨAO۷n覡CANAҭnɵ{T]tim
ing information^تɥ[W-
pӽsĶAӥBpGnXɮצNqAA]|ݭngprof]Ӧbinu
tilsM󪺩RO^CѾ\gprofmanual pageAioӸ`C

11/18/97Ķ


6.  s

ѩRAP@ɵ{w̶ۮe榡tʻPʵ*link*LqϥΩ*sĶ᪺Ʊ*P*sĶn{ϥήɩҵoͪƱ*oƤWYAϱoo@`ܱoF\hC]
and, actually, the overloading of the word `load' in a comparable but opposite
sense^LAA]NOoˤFAҥHդULߡC

FyLŪ̪xbAڭٰ̺ҵoͪƬ*ʺAJ*Ao@DD|bU@`ͨCA]|bOaݨڧʺAJyz*ʺAs*AL|Obo@`CyܻAo@`ҽͪAOoͦbsĶ᪺sC

6.1  @ɵ{w vsRA{w

إߵ{̫@ӨBJKOsF]NONҦp{զX_ӡAݬݬO_|FǤCMA@ǨƱOܦh{|Q---ҦpA}ɮסA۩ҦP}ɦp{N|Nxs{wɮ״ѵA{ϥΡCb@몺LinuxtΤWAoǤp{iHb/libP/usr/lib/ؿUC




AΪORA{wɡAs|X{һݪҲաAMڱN̫ɤCMӡA@ɵ{wӨANOoˤFC@ɵ{w|bɤdU@ӰOA*{ɡAJoӵ{w*CMA@ɵ{wOչϨϰܱopAPϥΧ֪OPϺЪŶCLinuxw欰Os@ɵ{wAunLinuxoǦ@ɵ{wܡANSDFM,LinuxN|sRAFCpGAQn@ɵ{wܡAˬdoǵ{w]*.sa
for a.out, *.so for ELF^O_b̸ӦbaAӥBOiŪC

bLinuxWARA{w|libname.ao˪W١FӦ@ɵ{wh٬lib
name.so.x.y.zABx.y.zOǸ˦C@ɵ{wq`|sŸVRA{w]ܭn^Pp.saɮסCзǪ{w|]t@ɻPRA{wخ榡C

AiHldd]List Dynamic Dependencies^ӬdXY{ݭnǦ@ɵ{wC

     $ ldd /usr/bin/lynx
	     libncurses.so.1 => /usr/lib/libncurses.so.1.9.6
	     libc.so.5 => /lib/libc.so.5.2.18

oObڪtΤWAWWWs*lynx*|̿libc.so.5 (the C library)Plibn
curses.so.1]׺ݾù^sbCYY{ʥFWߩʡA lddN|stati
cally linkedάOstatically linked (ELF)C

6.2  ׷fP]sin() bӵ{w̡H^



 "

nm
{wWӷ|CX{wW٩ҰѦҨ쪺ҦŸCoӫOiHΦbRAP@ɵ{wWC]AQDtcge
tattr()ObwqGAiHpA

     $ nm libncurses.so.1 |grep tcget
	      U tcgetattr








The Linux GCC HOWTOĶV0.2						     18



*U*X*wq*---]NOncurses{wΨtege
tattr()AOèSwqCA]iHo˰A

     $ nm libc.so.5 | grep tcget
     00010fe8 T __tcgetattr
     00010fe8 W tcgetattr
     00068718 T tcgetpgrp

*W*F*zA(weak)*ANŸwwqAiѤP{wt@wqҴNC²檺*`*wq]Otcgetp
grp^O*T*ҼХܡG



DҽͪDA²׫KOlibm.(so|a)FCҦwqb<math.h>ƳOdbmaths{wF]AAΨ䤤@ӨƮɡAݭnH-
lmѼƳs{wC

6.3  XɮסH

ld: Output file requires shared library `libfoo.so.1`

 ldPRObjMɮתWA|̾ڪtӦҤPAOߤ@@ӧAiHXz]wؿKO/usr/libFCpGAƱ樭BB{w]CJjMCAANH-
LﶵigccάOldC

nOAo{@IĪG]SANݬݨɮ׬OO٨ĨĪbaCNa.outӨAH-
lfooѼƨӳsA|XldhMlibfoo.sa]shared
stubs^FpGS\AN|Mlibfoo.a]static^CNELFӨA ld|lib
foo.soAMOlibfoo.aClibfoo.soq`O@ӳsŸAslibfoo.so.xC

6.4  إߧAۤv{w

6.4.1  

P䥦󪺵{@ˡA{w]ץbugsDsbC̤]iಣͥX@ǷsSIAثesbҲժ\ġAάONªCo勵bϥΥ̪{ӨAi|O@ӤjDCpG@{OھڨªSIӰ檺ܡAH

ҥHAڭ̤޶iF{ws[Cڭ̱N{w*n*P*Dn*ܧOAPɳWw*n*ܧO\Ψo{wµ{oͤ_{HCAiHq{wɦWX]ڤWAYAELFӨȶȬO@ѤjF~ŪNUhAKiլF^G
lib
foo.so.1.2DnO1AnO2CnsiuơA]iर򳣨S---libcbo@IWΤF*ץ{*[AӭqXFlibc.so.5.2.18o˪{wW١CnsYO@ǦrBuBάOiHCLASCIIrA]OܦXzC

ELFPa.out榡̥DntO@NOb]m@ɵ{woƤWFڭ̥ELFA]²@ǡC

6.4.2  ELFH쩳OFFzH

 "

 ELF]Executable and Linking Format^̪OUSL]UNIX System Laborato
ries^oiӦGi榡AثeΩSolarisPSystem V Release
4WCѩELFҼWuʻWLLinuxLhҥΪa.out榡A]GCCPC{woiHh1995~MwELFLinuxзǪGi榡C

6.4.2.1  SӤFH

 o@`OӦ۩/news-archives/comp.sys.sun.miscC











The Linux GCC HOWTOĶV0.2						     19



     ELF]Executable Linking For
     mat^OSVR4Ҥ޶is}تɮ榡CELF_COFFiOhXF֪\CHELFӨA*O*iѨϥΪ̦ۦ橵CELF@تɬ`ϡ]sec
     tions^ApC몺զXFӥBCiNס]ӤO@Twjp}C^CoǸ`ϻPCOFF@ˡAäݭnTwbYӦaA]ݭnHYضǱƦCCpGϥΪ̧ƱɮsơAKiH[Js`ϨتɤCELF]@ӧjӦOkA٬DWARF]Debug
     ging With Attribute Record Format^XثeLinuxä䴩CDWARF
     DIEs]Debugging Information Entries^sC|bELFΦ
     .debug`ϡCDWARF DIEsC@
     .debug`ϨëD@ǤֶqBTwjpTOXAӬO@NתCA֦ݩʡAӥB{Ʒ|Hd򭭨𪬸ƵcgXӡCDIEsүɮ쪺jqTOCOFF
     .debug`ϵLk䶵IC]OC++~ӹϡC^

     ELFɮ׬OqSVR4]Solaris 2.0 H^ELFs{w]ELF access
     library^sC{wiѤ@²KֳtELFCϥELFs{w̥Dnf@KOAAAݭnhݤ@ELFɪquaFCNUNIXɮצӨAOHElf*ӦsFIself_open()Aqɶ}lAAuݩIself_foo
     bar()ӳBzɮתY@YiAäݭnɮ׹ڦbϺФWimagedo@ζáC

ELFuIP@ŦELFũһݸgغصhWAwbELF-
HOWTOפΡFڨäbo߽kCELF HOWTOӻPo󦳦P˪DD~OC

6.4.2.2  ELF@ɵ{w

YQlibfoo.so@ɵ{wA򥻪BJ|UoˡG

     $ gcc -fPIC -c *.c
     $ gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 *.o
     $ ln -s libfoo.so.1.0 libfoo.so.1
     $ ln -s libfoo.so.1 libfoo.so
     $ LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH

o|ͤ@ӦWlibfoo.so.1.0@ɵ{wAHεldAs]lib
foo.so^٦ϱoʺAJ{]dynamic loader^쥦]lib
foo.so.1^CFiաAڭ̱Nثeؿ[LD_LIBRARY_PATH̡C



AzzֹD{ws\ɡAOѤF⥦p/usr/local/libؿUAåBs]wTs|Clib
foo.so.1Plibfoo.so.1.0s|ldcon
fig̤_sANjtΨӻAldconfig|b}L{Clib
foo.sosѤʤ覡sCpGA{wҦզl]pYɵ^@šA`Oۤ@AAסA²檺kNOlib
foo.so -> libfoo.so.1Fp@ӡAldcon
figK|APɫOd̷ssCnOASo򰵡AAۦ]wFFN|bƤyd_ʩǪDX{CɭԡAiOڨSAڡI

     $ su
     # cp libfoo.so.1.0 /usr/local/lib
     # /sbin/ldconfig
     # ( cd /usr/local/lib ; ln -s libfoo.so.1 libfoo.so )

6.4.2.3  sBsonamePŸs


 "

C@ӵ{w@son
ameCso{bjM{wo˪@ӦW١AsK|Nson
ameJsGiɤAӤObB@ڪɦWCb{AʺAJ{|jM֦son
ameo˪ɦWɮסAӤO{wɦWC]A@ӦWlib
foo.so{wANiH@libbar.sosonameFCӥBҦslib








The Linux GCC HOWTOĶV0.2						     20



bar.so{A{}lɡA|M䪺KOlibbar.soFC

oť_Ӧn@INq]SAOo@IAAѼƭӤPP@ӵ{wOpb@tΤW@s]AoO䤧_CLinux{wзǪRW覡ApOlib
foo.so.1.2AӥBoӵ{w@libfoo.so.1son
ameCpG{wO[зǵ{wؿU]e.g. /usr/lib^Aldcon
fig|إ߲Ÿslibfoo.so.1 -> lib
foo.so.1.2AϨ䥿TimageCA]ݭnslibfoo.so -> lib
foo.so.1Alds쥿TsonameC

ҥHoAAץ{wbugsAάOK[Fsƶih]󤣷|{s{yQvTܡ^AA|ئ{wAOd쥻wson
ameAM{wɦWCA{wܧ|ϱo{{_AAuݼW[son
ames---ҤAٷslibfoo.so.2.0Asonameܦlib
foo.so.2C򱵵ۡAANlibfoo.sosVsFܦA@ɤSA׫_FMI

AnHؤ覡Ӵ{wRWALoTOӦnǲΡCELFᤩAb{wRWWuʡA|ϱoHݩIIdMpFo˪uʦbA]äܧANohΥC

ELF`G]gѧAʹ[o{ӺDһG{wDn@ŷ|}aۮeʡFӦn@ūhiण|FHU覡ӳsAҦ@N|ۦwLƤFC

     gcc -shared -Wl,-soname,libfoo.so.major -o libfoo.so.major.minor

6.4.3  a.out---ª榡\$3

إߦ@ɵ{wKQʬO@ŦELFDn]@C]O,a.outi٬OγBbCWftph<URL:ftp://tsx-11.mit.edu/pub/linux/pack
ages/GCC/src/tools-2.17.tar.gz>FYA|o{20iHCCŪCګܤwۤvҬ{o򪺲OɭPAiOqWU嶡AӤ]iHܲMXڱqӤY{ۤv}ʮaI:-)

6.4.3.1  ZMAGIC vs QMAGIC


 "

QMAGICO@®榡a.out]٬ZMAGIC^i
榡Aoخ榡|ϱoĤ@ӤLkmapC0-4096d򤺨Smap
pingsbɡAhi\NULL dereference trap
ping[eCҲͪɮOAɷ|p]j1Kk^C

uYN@os䴩ZMAGICA@bwIJçs䴩oخ榡FӥثeȤ䴩QMAGICӤwCƹWAoèShjvTAO]ثe֤ߨخ榡C

*file*ROӥiHT{{OOQMAGIC榡C

6.4.3.2  ɮװtm

@a.out(DLL)@ɵ{w]tӯuꪺɮ׻P@ӳsŸCN*foo*oӥΩ󰵬dҪ{wӨAoɮ׷|Olib
foo.saPlibfoo.so.1.2FsŸ|Olibfoo.so.1AӥB|Vlib
foo.so.1.2CoǬOΪH

bsĶɡAld|Mlib
foo.saCoO{w*stub*ɮסCӥBtҦsһݪexportedƻPVƪСC

AʺAJ{|Mlib
foo.so.1CoȶȬO@ӲŸsAӤOuꪺɮסCG{wissBwץ~AӤ|l󦹮ɥbϥΦ{wε{Cbs---plib
foo.so.1.3---we{ɡAldcon
fig|H@Lpާ@ANsVsAϱo쥻ϥª{|P쵷@C

DLL{w]ڪDoOLת---ҥHڴXD^aI^q`|񥦭̪RAƥnӱojhC̬OH*}]holes^*ΦӫOdŶHK᪺XRCo*}*iHΥ󪺺ϺЪŶC@²檺cpIsAάOϥmakehole{ANiHFoˮĪGC]̪}OTwbP@mWAҥHbإߵ{wAAiH⥦̮CLAdUnյۮELF{wC








The Linux GCC HOWTOĶV0.2						     21



6.4.3.3  ``libc-lite''?

libc-
liteOqŪlibcCiΨӦsbϺФWA]iHjCLUNIXȦCS]tcurses,
dbm, term
cap{XCpGA/lib/libc.so.4Os@litelibcAĳAH㪺NC

6.4.4  sG`D

AsɩҾDJDHڡIڥiरƤ]|AOunֿnFƶqAڷ|⥦̼g_*C

      AQ@ɡA{osRAI



	    ˬdAѵldsO_TAldC@ӹ@ɵ{wANELFӨAoO@ӲŸslib
	    foo.soAsimageFNa.outӨANOlibfoo.saɤFCܦhHNELF
	    binutils
	    2.5@Ŧ2.6ANͤFoӰD---jM@ɵ{wɸzAҥHèSNҦsإ߰_ӡCӡAFP䥦[cۮeAoRz欰QHRFAt~Ao˪*z*P_~v۷Aҳy·Ф񥦩ҸѨMD٦hAҥHdۤ]O`HFpkhI

      DLLu{mkimage䤣libgccH


	    libc.so.4.5.xAlibgccwAO@ɪ榡C]AAb*-lgcc*X{BH`gcc
	    -print-libgcc-file-name`N]㪺˳޸]back-
	    quotes^^Ct~ARҦ/usr/lib/libgcc*ɮסCoIܭnC

      __NEEDS_SHRLIB_libc_4 multiply defined messages
	    OP˪Dҳyt@صGC

      ``Assertion failure'' message when rebuilding a DLL ?
	    o@Ți઺]OAbljump.varsɮפAѩOdŶӤ֡AHPy䤤@jump
	    table
	    slotsCAiHu{X2.17.tar.gzMҴѪget
	    sizeROAwXҦåǪܸCiߤ@ѨMkOAѰ{wDnsAj^줣ۮe~NC

      ld: output file needs shared library libc.so.4
	    q`oOoͦbAs{wOlibc]pX{w^AӥBbROCΤF-
	    gѼơAoS@֨ϥ-staticAҵoX~TC

	    @ɵ{w.sa
	    stubsq`@ӥwqŸ_NEEDS_SHRLIB_libc_4Fo@Iiǥlibc.sa
	    stubӸѨMAMӡAH-
	    gӽsĶɡA|ϱosHlibg.alibc.aӵF]oӲŸ@NSѨMA]N|ɭPW~TFC

	    `AH-gXsĶɧOѤF[W-staticAMNO-
	    gӳsCq`AH-
	    gsĶUӿWߪɮ׮ɡAoTwgAsɴNiHݭnFC


7.  ʺAJ

o@`ثeO²uF@IFڱELF HOWTOɡANOoAXiɭԤFC









The Linux GCC HOWTOĶV0.2						     22



7.1  򥻷

 Linux@ɵ{wApGeAwŪW@`AQ{b@ť칳o˪AK|ߨPYC@ǷӺDҦӨObsɴKӧu@AJɴ~৹C

7.2  ~T

As~HڡIڤ|󪺨ơALڥiH⥦̼g_**

      can't load library: /lib/libxxx.so, Incompatible version
	    ]a. out only^ oOASxxx{wTDnCiOHHH
	    KK˭ӳsAثe֦NiHFApGBܡANu|yA{~ӤwChs.ELFp|yUo˪TG

		 ftp: can't load library 'libreadline.so.2'

      warning using incompatible library version xxx
	    ]a. out
	    only^A{wn_o{ΨӽsĶ٭n¡C{̵MiHCuOiաIڷQA@ӯӨSˮ`aI

7.3  ʺAJB@


 "

@ܼƷ|ʺAJҤCjܼƹlddγ~n_@users٭nӱohCӥBiHܤK]wlddtXUذѼƨӰCoܼƥ]AA

    LD_BIND_NOW ---
     `AƦbIseO|{M䪺C]woӺX|ϱo{w@JAҦMK|o͡APɤ]y_lɶCCAQյ{ATwҦsSDɡAoXNܱoܦΡC

    LD_PRELOADiH]w@ɮסAϨ㦳*л\*ƩwqOCҦpApGAnհOt貤AӥBٷQm*mal
     loc*AAiHgnǳƴƵ{Aç⥦sĶmallolc.AMG


	  $ LD_PRELOAD=malloc.o; export LD_PRELOAD
	  $ some_test_program



     LD_ELF_PRELOAD P LD_AOUT_PRELOAD
     AOȾAΩ󥿽TGi쫬ACpG]wF LD_something_PRELOAD P
     LD_PRELOAD AT@ӷ|QΨC

   
     LD_LIBRARY_PATHO@sHjؿW١AΨӷjM@ɵ{wCldӨAèS󪺼vTFoub~vTCt~Ase
     tuidPset
     gid{ӨAo@OLĪCLD_ELF_LIBRARY_PATHPLD_AOUT_LIBRARY_PATHoغXiھڦUOGi쫬OɦVPjM|C@륿`B@UAӷ|ΨLD_LIBRARY_PATHFݭnjMؿ[/etc/ld.so.conf/̡FM᭫sld
     configC

     LD_NOWARN ȾAΩa.outC@]wFo@]LD_NOWARN=true; export
     LD_NOWARN^A|iDJBzfatal-warn
     ings]Onۮe^ĵiTC

    LD_WARNȾAΩELFC]wo@ɡA|Nq`OPRTCan*t find
     libraryഫĵiTC勵`ާ@ӨAoèShjγBAiOlddNܭnFC









The Linux GCC HOWTOĶV0.2						     23



    LD_TRACE_LOADED_OBJECTSȾAΩELFCӥB|ϱo{H̬OlddҰ檺G


	  $ LD_TRACE_LOADED_OBJECTS=true /usr/bin/lynx
		  libncurses.so.1 => /usr/lib/libncurses.so.1.9.6
		  libc.so.5 => /lib/libc.so.5.2.18



7.4  HʺAJg{


 "

pGAܼxSolaris
2.xҤ䴩ʺAJu@ܡAA|o{LinuxboIWPD`۪Co@bH.J.LuELF{]p󤺻Pdlopen(3)man
ual page]iHbld.soMW^WsxQסCo̦Ӥ²dҡGH-
ldlsC

     #include <dlfcn.h>
     #include <stdio.h>

     main()
     {
       void *libc;
       void (*printf_call)();

       if(libc=dlopen("/lib/libc.so.5",RTLD_LAZY))
       {
	 printf_call=dlsym(libc,"printf");
	 (*printf_call)("hello, world\n");
       }

     }


8.  PoiHhp

8.1  Bug

 "

 DgUӡCoOwLinuxAάOgccb䥦tΤWҵoͪDCPker
nelܡHΪ̬O{wHpGRA覡sADOONFHAiH`@pq{ӮiܳobugܡH

AFoǨƱAAN|D{bugsOCNgccӨAbug{ǬOHin
foɨӻCpGOld.soάOCBmaths{wANemailHlinux-gcc@vger.rut
gers.eduCpGi઺ܡA]t@ۤvۨp{HiܳobugAӥBWAyzAQno{ǤPڤWSFǤC

8.2  Uoi

pGAQnoigccάOC{wAĤ@ƴNO[Jlinux-gcc@vger.rut
gers.eduqH׾¡CpGAuOQݬݳqH׾¦bQרǤAo̦@ӽ׾ªarchivesA<URL:http://homer.ncm.com/linux-
gcc/>CUӪơANݧAQFC








The Linux GCC HOWTOĶV0.2						     24



9.  y

9.1  WH]


     Only presidents, editors, and people with tapeworms have the right to
     use the editorial ``we''.


(Mark Twain)

oHOWTOXGڴөMitchum DsouzaGCC-FAQF
󤤤jTOӦ۩GCC-
FAQCoΨ쪺Ĥ@H٥NWAiڭ̨H䤤@ӡFiHAnO䤤@ӤH٨SչLoǡFpGNFAwСBFAtΩάOdoAdlAiOڨSAڡI"Ao˪ܾAΩڭǨWC

o󦳰^mWHhpUҦC]HASCIIXǦCX^G Andrew Tefft, Axel
Boldt, Bill Metzenthen, Bruce Evans, Bruno Haible, Daniel Barlow, Daniel Quin
lan, David Engel, Dirk Hohndel, Eric Youngdale, Fergus Henderson, H.J. Lu, Jens
Schweikhardt, Kai Petzke, Michael Meissner, Mitchum DSouza, Olaf Flebbe, Paul
Gortmaker, Rik Faith, Steven S. Dick, Tuomas J Lukka, M٦Linux Tor
valdsASFLAoӹBʴNܱo@INq]SFAҥHiLt檺C:-)

Фnıo󪺫_ǤBApGzWrSX{boCpGzo]HOWTOάOFAQ^gL^mܡAemailڡAڷ|勵LӪC

9.2  ½Ķ

ثeAo٨Sw½ĶX{CpGAƱͤ@ӥXӡAоޥhAL@woiDڬƩyCy|OAQn½yAv]ܿѡ^unXʤ@AL٬Od\@ǧaAެO˰DAڳ|ַܼNC

9.3  w󪺦^X

HHdan@detached.demon.co.ukCڪPGP public key (ID 5F263625)
ibڪMweb pages9 WϥΡApGAıoƱnOKܡC

9.4  XkwWw

ĥιLӼФݩӧO̡C

oHOWTO󪺪vݩDaniel Barlow <dan@detached.demon.co.uk>C
AiH󫬦CA]AΪBql覡ƥͲBǧGάOGCC-
HOWTOAunovnOsbҦƻs~Cӷ~O\AӥBڹyAo򰵡ALAګܧƱAqڦӸ`C

קAAO½ĶBXRoBqolͥXLάOXLLinux
HOWTO󵥡A`ovnC]NOApGAѰuHOWTOgXLAAOiHolͥXӪ[WB~AvT󪺵ovCMAǯSOpOiHҥ~AoIAлPLinuxդHsAqllHca}NbYC

`ӨAڭ̧ƱҦHOWTOzLUؤP޹Di઺ǼXhAMӡAPˤ]ƱovniHsdbYALoHOW
TOs󪺭peAڭ̳@NAqC

pGDAлPLinux HOWTOդHTim BynumsôAemail addressOgregh@sun
site.unc.eduC

pUG All trademarks used in this document are acknowledged as being

____________________

9. <URL:http://ftp.linux.org.uk/~barlow/>







The Linux GCC HOWTOĶV0.2						     25



owned by their respective owners.

This document is copyright (C) 1996 Daniel Barlow <dan@detached.demon.co.uk> It
may be reproduced and distributed in whole or in part, in any medium physical
or electronic, as long as this copyright notice is retained on all copies. Com
mercial redistribution is allowed and encouraged; however, the author would
like to be notified of any such distributions.

All translations, derivative works, or aggregate works incorporating any Linux
HOWTO documents must be covered under this copyright notice.  That is, you may
not produce a derivative work from a HOWTO and impose additional restrictions
on its distribution. Exceptions to these rules may be granted under certain
conditions; please contact the Linux HOWTO coordinator at the address given
below.

In short, we wish to promote dissemination of this information through as many
channels as possible. However, we do wish to retain copyright on the HOWTO doc
uments, and would like to be notified of any plans to redistribute the HOWTOs.

If you have questions, please contact Tim Bynum, the Linux HOWTO coordinator,
at linux-howto@sunsite.unc.edu via email.

6/3/98W


10.  

}YpGOƦrrAƦCNASCIIXǡC

     -fwritable-strings 39 (section .39-hn .tm "GETHN:index.39 not defined" ,
     page .39-pn .tm "GETPN:index.39 not defined" ) 56 (section .56-hn .tm
     "GETHN:index.56 not defined" , page .56-pn .tm "GETPN:index.56 not
     defined" )

     /lib/cpp 16 (section .16-hn .tm "GETHN:index.16 not defined" , page
     .16-pn .tm "GETPN:index.16 not defined" )

     a.out 1 (section .1-hn .tm "GETHN:index.1 not defined" , page .1-pn .tm
     "GETPN:index.1 not defined" )

     ar 10 (section .10-hn .tm "GETHN:index.10 not defined" , page .10-pn .tm
     "GETPN:index.10 not defined" )

     as 8 (section .8-hn .tm "GETHN:index.8 not defined" , page .8-pn .tm
     "GETPN:index.8 not defined" )

     <asm/*.h> 19 (section .19-hn .tm "GETHN:index.19 not defined" , page
     .19-pn .tm "GETPN:index.19 not defined" )

     atoi() 40 (section .40-hn .tm "GETHN:index.40 not defined" , page .40-pn
     .tm "GETPN:index.40 not defined" )

     atol() 41 (section .41-hn .tm "GETHN:index.41 not defined" , page .41-pn
     .tm "GETPN:index.41 not defined" )








The Linux GCC HOWTOĶV0.2						     26



     binaries too big 63 (section .63-hn .tm "GETHN:index.63 not defined" ,
     page .63-pn .tm "GETPN:index.63 not defined" ) 65 (section .65-hn .tm
     "GETHN:index.65 not defined" , page .65-pn .tm "GETPN:index.65 not
     defined" ) 77 (section .77-hn .tm "GETHN:index.77 not defined" , page
     .77-pn .tm "GETPN:index.77 not defined" )

     chewing gum 3 (section .3-hn .tm "GETHN:index.3 not defined" , page .3-pn
     .tm "GETPN:index.3 not defined" )

     cos() 68 (section .68-hn .tm "GETHN:index.68 not defined" , page .68-pn
     .tm "GETPN:index.68 not defined" )

     debugging 59 (section .59-hn .tm "GETHN:index.59 not defined" , page
     .59-pn .tm "GETPN:index.59 not defined" )

     dlopen() 82 (section .82-hn .tm "GETHN:index.82 not defined" , page
     .82-pn .tm "GETPN:index.82 not defined" )

     dlsym() 83 (section .83-hn .tm "GETHN:index.83 not defined" , page .83-pn
     .tm "GETPN:index.83 not defined" )

     documentation 4 (section .4-hn .tm "GETHN:index.4 not defined" , page
     .4-pn .tm "GETPN:index.4 not defined" )

     EINTR 52 (section .52-hn .tm "GETHN:index.52 not defined" , page .52-pn
     .tm "GETPN:index.52 not defined" )

     elf 0 (section .0-hn .tm "GETHN:index.0 not defined" , page .0-pn .tm
     "GETPN:index.0 not defined" ) 71 (section .71-hn .tm "GETHN:index.71 not
     defined" , page .71-pn .tm "GETPN:index.71 not defined" )

     execl() 57 (section .57-hn .tm "GETHN:index.57 not defined" , page .57-pn
     .tm "GETPN:index.57 not defined" )

     fcntl 47 (section .47-hn .tm "GETHN:index.47 not defined" , page .47-pn
     .tm "GETPN:index.47 not defined" )

     FD_CLR 44 (section .44-hn .tm "GETHN:index.44 not defined" , page .44-pn
     .tm "GETPN:index.44 not defined" )

     FD_ISSET 45 (section .45-hn .tm "GETHN:index.45 not defined" , page
     .45-pn .tm "GETPN:index.45 not defined" )

     FD_SET 43 (section .43-hn .tm "GETHN:index.43 not defined" , page .43-pn
     .tm "GETPN:index.43 not defined" )

     FD_ZERO 46 (section .46-hn .tm "GETHN:index.46 not defined" , page .46-pn
     .tm "GETPN:index.46 not defined" )

     file 2 (section .2-hn .tm "GETHN:index.2 not defined" , page .2-pn .tm
     "GETPN:index.2 not defined" )

     <float.h> 20 (section .20-hn .tm "GETHN:index.20 not defined" , page
     .20-pn .tm "GETPN:index.20 not defined" )








The Linux GCC HOWTOĶV0.2						     27



     gcc 6 (section .6-hn .tm "GETHN:index.6 not defined" , page .6-pn .tm
     "GETPN:index.6 not defined" )

     gcc -fomit-frame-pointer 61 (section .61-hn .tm "GETHN:index.61 not
     defined" , page .61-pn .tm "GETPN:index.61 not defined" )

     gcc -g 60 (section .60-hn .tm "GETHN:index.60 not defined" , page .60-pn
     .tm "GETPN:index.60 not defined" )

     gcc -v 14 (section .14-hn .tm "GETHN:index.14 not defined" , page .14-pn
     .tm "GETPN:index.14 not defined" )

     gcc, bugs 15 (section .15-hn .tm "GETHN:index.15 not defined" , page
     .15-pn .tm "GETPN:index.15 not defined" ) 28 (section .28-hn .tm
     "GETHN:index.28 not defined" , page .28-pn .tm "GETPN:index.28 not
     defined" ) 29 (section .29-hn .tm "GETHN:index.29 not defined" , page
     .29-pn .tm "GETPN:index.29 not defined" ) 84 (section .84-hn .tm
     "GETHN:index.84 not defined" , page .84-pn .tm "GETPN:index.84 not
     defined" )

     gcc, flags 13 (section .13-hn .tm "GETHN:index.13 not defined" , page
     .13-pn .tm "GETPN:index.13 not defined" ) 25 (section .25-hn .tm
     "GETHN:index.25 not defined" , page .25-pn .tm "GETPN:index.25 not
     defined" ) 26 (section .26-hn .tm "GETHN:index.26 not defined" , page
     .26-pn .tm "GETPN:index.26 not defined" )

     gdb 64 (section .64-hn .tm "GETHN:index.64 not defined" , page .64-pn .tm
     "GETPN:index.64 not defined" )

     header files 17 (section .17-hn .tm "GETHN:index.17 not defined" , page
     .17-pn .tm "GETPN:index.17 not defined" )

     interrupted system calls 51 (section .51-hn .tm "GETHN:index.51 not
     defined" , page .51-pn .tm "GETPN:index.51 not defined" )

     ld 9 (section .9-hn .tm "GETHN:index.9 not defined" , page .9-pn .tm
     "GETPN:index.9 not defined" )

     LD_* environment variables 80 (section .80-hn .tm "GETHN:index.80 not
     defined" , page .80-pn .tm "GETPN:index.80 not defined" )

     ldd 81 (section .81-hn .tm "GETHN:index.81 not defined" , page .81-pn .tm
     "GETPN:index.81 not defined" )

     libc 7 (section .7-hn .tm "GETHN:index.7 not defined" , page .7-pn .tm
     "GETPN:index.7 not defined" )

     libg.a 62 (section .62-hn .tm "GETHN:index.62 not defined" , page .62-pn
     .tm "GETPN:index.62 not defined" )

     libgcc 79 (section .79-hn .tm "GETHN:index.79 not defined" , page .79-pn
     .tm "GETPN:index.79 not defined" )










The Linux GCC HOWTOĶV0.2						     28



     <limits.h> 21 (section .21-hn .tm "GETHN:index.21 not defined" , page
     .21-pn .tm "GETPN:index.21 not defined" )

     lint 58 (section .58-hn .tm "GETHN:index.58 not defined" , page .58-pn
     .tm "GETPN:index.58 not defined" )

     <linux/*.h> 18 (section .18-hn .tm "GETHN:index.18 not defined" , page
     .18-pn .tm "GETPN:index.18 not defined" )

     manual pages 5 (section .5-hn .tm "GETHN:index.5 not defined" , page
     .5-pn .tm "GETPN:index.5 not defined" )

     <math.h> 70 (section .70-hn .tm "GETHN:index.70 not defined" , page
     .70-pn .tm "GETPN:index.70 not defined" )

     maths 69 (section .69-hn .tm "GETHN:index.69 not defined" , page .69-pn
     .tm "GETPN:index.69 not defined" )

     mktemp() 55 (section .55-hn .tm "GETHN:index.55 not defined" , page
     .55-pn .tm "GETPN:index.55 not defined" )

     optimisation 27 (section .27-hn .tm "GETHN:index.27 not defined" , page
     .27-pn .tm "GETPN:index.27 not defined" )

     QMAGIC 76 (section .76-hn .tm "GETHN:index.76 not defined" , page .76-pn
     .tm "GETPN:index.76 not defined" )

     segmentation fault 30 (section .30-hn .tm "GETHN:index.30 not defined" ,
     page .30-pn .tm "GETPN:index.30 not defined" ) 54 (section .54-hn .tm
     "GETHN:index.54 not defined" , page .54-pn .tm "GETPN:index.54 not
     defined" )

     segmentation fault, in GCC 33 (section .33-hn .tm "GETHN:index.33 not
     defined" , page .33-pn .tm "GETPN:index.33 not defined" )

     select() 50 (section .50-hn .tm "GETHN:index.50 not defined" , page
     .50-pn .tm "GETPN:index.50 not defined" )

     SIGBUS 34 (section .34-hn .tm "GETHN:index.34 not defined" , page .34-pn
     .tm "GETPN:index.34 not defined" )

     SIGEMT 35 (section .35-hn .tm "GETHN:index.35 not defined" , page .35-pn
     .tm "GETPN:index.35 not defined" )

     SIGIOT 36 (section .36-hn .tm "GETHN:index.36 not defined" , page .36-pn
     .tm "GETPN:index.36 not defined" )

     SIGSEGV 31 (section .31-hn .tm "GETHN:index.31 not defined" , page .31-pn
     .tm "GETPN:index.31 not defined" ) 53 (section .53-hn .tm "GETHN:index.53
     not defined" , page .53-pn .tm "GETPN:index.53 not defined" )

     SIGSEGV, in gcc 32 (section .32-hn .tm "GETHN:index.32 not defined" ,
     page .32-pn .tm "GETPN:index.32 not defined" )









The Linux GCC HOWTOĶV0.2						     29



     SIGSYS 38 (section .38-hn .tm "GETHN:index.38 not defined" , page .38-pn
     .tm "GETPN:index.38 not defined" )

     SIGTRAP 37 (section .37-hn .tm "GETHN:index.37 not defined" , page .37-pn
     .tm "GETPN:index.37 not defined" )

     sin() 67 (section .67-hn .tm "GETHN:index.67 not defined" , page .67-pn
     .tm "GETPN:index.67 not defined" )

     soname 73 (section .73-hn .tm "GETHN:index.73 not defined" , page .73-pn
     .tm "GETPN:index.73 not defined" )

     sprintf() 42 (section .42-hn .tm "GETHN:index.42 not defined" , page
     .42-pn .tm "GETPN:index.42 not defined" )

     statically linked binaries, unexpected 66 (section .66-hn .tm
     "GETHN:index.66 not defined" , page .66-pn .tm "GETPN:index.66 not
     defined" ) 78 (section .78-hn .tm "GETHN:index.78 not defined" , page
     .78-pn .tm "GETPN:index.78 not defined" )

     <stdarg.h> 23 (section .23-hn .tm "GETHN:index.23 not defined" , page
     .23-pn .tm "GETPN:index.23 not defined" )

     <stddef.h> 24 (section .24-hn .tm "GETHN:index.24 not defined" , page
     .24-pn .tm "GETPN:index.24 not defined" )

     strings 11 (section .11-hn .tm "GETHN:index.11 not defined" , page .11-pn
     .tm "GETPN:index.11 not defined" )

     <sys/time.h> 48 (section .48-hn .tm "GETHN:index.48 not defined" , page
     .48-pn .tm "GETPN:index.48 not defined" )

     <unistd.h> 49 (section .49-hn .tm "GETHN:index.49 not defined" , page
     .49-pn .tm "GETPN:index.49 not defined" )

     <varargs.h> 22 (section .22-hn .tm "GETHN:index.22 not defined" , page
     .22-pn .tm "GETPN:index.22 not defined" )

     version numbers 12 (section .12-hn .tm "GETHN:index.12 not defined" ,
     page .12-pn .tm "GETPN:index.12 not defined" ) 74 (section .74-hn .tm
     "GETHN:index.74 not defined" , page .74-pn .tm "GETPN:index.74 not
     defined" )

     weird things 72 (section .72-hn .tm "GETHN:index.72 not defined" , page
     .72-pn .tm "GETPN:index.72 not defined" )

     ZMAGIC 75 (section .75-hn .tm "GETHN:index.75 not defined" , page .75-pn
     .tm "GETPN:index.75 not defined" )














The Linux GCC HOWTOĶV0.2						     30





































































				   CONTENTS



1.  滷I ............................................................ 1
    1.1 Ķ̪ ............................................................ 1
    1.2 ʻPR .............................................................. 2
    1.3 @̪py .......................................................... 2
    1.4 LPƪ .......................................................... 2

2.  FFbH ............................................................ 2
    2.1 GCC-HOWTObH ................................................... 2
    2.2 GCCƤSbH ............................................. 3
    2.3 GCC   ............................................................... 3
    2.4 C{]PY ..................................................... 3
    2.5 pu (as, ld, ar, strings etc) .............................. 4

3.  GCCw˻PGCC]w .................................................... 4
    3.1 GCC ........................................................... 4
    3.2 FF˦n᳣hF? ............................................. 5
    3.3 Yɣz?Yɣz? .............................................. 6
    3.4 إߥesĶ(Building cross compilers) ............................ 7

4.  ӵ{PsĶ{ ...................................................... 7
    4.1 gccۦwqŸ ................................................... 7
    4.2 uWDU ........................................................ 7
    4.3 ӯO ............................................................ 9

5.  Pʺ ............................................................. 14
    5.1 wv]lint^ ............................................... 14
    5.2  ............................................................... 14
    5.3 ʺ ............................................................... 17

6.  s ................................................................... 17
    6.1 @ɵ{w vsRA{w ............................................ 17
    6.2 ׷fP]sin() bӵ{w̡H^ ............................. 17
    6.3 XɮסH ............................................................ 18
    6.4 إߧAۤv{w ................................................. 18

7.  ʺAJ ............................................................... 21
    7.1 򥻷 ........................................................... 22
    7.2 ~T ........................................................... 22
    7.3 ʺAJB@ ............................................... 22
    7.4 HʺAJg{ ................................................. 23

8.  PoiHhp ......................................................... 23
    8.1 Bug ............................................................ 23
    8.2 Uoi ........................................................... 23

9.  y ................................................................... 24
    9.1 WH] ............................................................. 24
    9.2 ½Ķ ............................................................... 24
    9.3 w󪺦^X ..................................................... 24
    9.4


				       i









	XkwWw ..................................................... 24

10.  ................................................................... 25





















































				       ii


