ld






ld − GNU ãªã³ã« LD ã®ä½¿ãæ¹

ld [options] objfile ...

ld ã¯ãããã¤ãã®ãªãã¸ã§ã¯ããã¡ã¤ã«ã¨ã¢ã¼ã«ã¤ããã¡ã¤ã«ã
çµåãããã®ãã¼ã¿ãåéç½®ããã·ã³ãã«ã®åç§ãçµã³ã¤ãã¾ãã é常ããã‐
ã°ã©ã ã®ã³ã³ãã¤ã«ã®æçµæ®µéããld ãå®è¡ãããã¨ã§ãã

     ld ã¯ããªã³ã¯å¦çãæ示çãã¤çµ±åçã«å¶å¾¡ããããã«ã AT&T
ã®ãªã³ã¯ã¨ãã£ã¿ã³ãã³ãè¨èªã®ææ³ã®ä¸ä½äºæã»ããã§
è¨è¿°ããããªã³ã«ã³ãã³ãè¨èªã®ãã¡ã¤ã«ãåãä»ãã¾ãã

     ãã®ããã¥ã¢ã«ãã¼ã¸ã§ã¯ã³ãã³ãè¨èªã«ã¤ãã¦ãµãã¾ããã
ã³ãã³ãè¨èªã®è©³ç´°ã¨ GNU ãªã³ã«ã®å¥ã®å´é¢ããã®è©³ç´°ã«ã¤ãã¦ã¯
"info" ã® ld ã®é ãã¾ãã¯ããã¥ã¢ã« ld: the GNU linker
ãåç§ãã¦ãã ããã

     ãã®ãã¼ã¸ã§ã³ã® ld ã¯ããªãã¸ã§ã¯ããã¡ã¤ã«ã®æä½ã«æ±ç¨ã® BFD
ã©ã¤ãã©ãªã使ç¨ãã¾ãã ããã«ãã£ã¦ ld ã¯ãå¤ãã®ç°ãªã£ãå½¢å¼ −−−
ä¾ãã° COFF ã "a.out" ã®ãããªãªãã¸ã§ã¯ããã¡ã¤ã« −−− ã®èª‐
ã¿è¾¼ã¿ãçµåãæ¸ãè¾¼ã¿ãåºæ¥ãããã«ãªã£ã¦ãã¾ãã
ç°ãªãå½¢å¼ã®ãã¡ã¤ã«ãä¸ç·ã«ãªã³ã¯ãã¦ã
ä»»æã®å©ç¨å¯è½ãªãªãã¸ã§ã¯ããã¡ã¤ã«ãçæã§ãã¾ãã

     ãã®æè»æ§ã®ä»ã«ããGNU ãªã³ã«ã¯ã診ææå ±ã®æä¾ã¨ããç¹ã§
ä»ã®ãªã³ã«ãããå½¹ã«ç«ã¡ã¾ãã
å¤ãã®ãªã³ã«ã¯ãã¨ã©ã¼ãèµ·ãããæç¹ã§å³åº§ã«å®è¡ãä¸æãã¦ãã¾ãã¾ããã
ld ã¯å¯è½ãªéãå®è¡ãç¶ããã®ã§ãä»ã®ã¨ã©ã¼ãçªãæ¢ãããã¨ã ã§ãã¾ãã
(ã¾ããå ´åã«ãã£ã¦ã¯ãã¨ã©ã¼ã«ããããããåºåãã¡ã¤ã«ãçæãã¾ã)ã

     GNU ãªã³ã« ld ã¯ãåºãç¯å²ã®å種ç¶æ³ã«å¯¾å¿ãããã¨ã
ããã¦ä»ã®ãªã³ã«ã¨ã®äºææ§ãã§ããã ãç¶æãããã¨ãç®æãã¦ãã¾ãã
ãã®ããããã®åä½ãå¶å¾¡ããããã®å¤ãã®é¸æè¢ãããã¾ãã

ãã®ãªã³ã«ã¯ããã³ãã ããéã®ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ãåãã¦ãã¾ããã
å®éã«ã¯ããããªãå±é¢ã«ããã¦ã使ç¨ããããªãã·ã§ã³ã¯ãå°ãããããã¾ããã
ä¾ãã°ãld ããã使ãããã®ã¯ãUnix ã®æ¨æºã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãã ld
ããµãã¼ãããæ¨æºã® Unix ã·ã¹ãã ä¸ã§ãªã³ã¯ããå ´åã§ãã
ãã®ãããªã·ã¹ãã ä¸ã§ã¯ã"hello.o" ã¨ãããã¡ã¤ã«ã
ãªã³ã¯ããããã«ã¯ä»¥ä¸ã®ããã«ãã¾ã:

             ld ‐o <output> /lib/crt0.o hello.o ‐lc

     ããã¯ã"/lib/crt0.o" 㨠"hello.o"ãããã¦
æ¨æºã§æ¤ç´¢ããããã£ã¬ã¯ããªã«ããã©ã¤ãã©ãª "libc.a" ã
ãªã³ã¯ãã¦ãoutput ã¨ããååã®ãã¡ã¤ã«ãçæãããã¨ã ld ã«
対ãã¦æ示ãã¦ãã¾ãã

     ld ã«å¯¾ããããã¤ãã®ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã¯ãã³ãã³ãã©ã¤ã³ã®
ã©ãã§ã§ãæå®ã§ãã¾ãã ãããããã¡ã¤ã«ãåç§ãã −l ã −T
ã®ãããªãªãã·ã§ã³ã¯ã
ãªãã¸ã§ã¯ããã¡ã¤ã«ããã®ä»ã®ãã¡ã¤ã«ãªãã·ã§ã³ã«é¢é£ãã¦ããã
ã³ãã³ãã©ã¤ã³ä¸ã«ãªãã·ã§ã³ãç¾ããæç¹ã§ãã¡ã¤ã«ãèªã¿ã¾ãã
ãã¡ã¤ã«ãåããªããªãã·ã§ã³ãç°ãªãå¼æ°ãæå®ãã¦ç¹°è¿ãã¦ãã









                             ‐2‐


ãã以ä¸å½±é¿ããªãããããã㯠(ã³ãã³ãã©ã¤ã³ä¸ã§å·¦ã«ãã)
ããã¾ã§ã®æå®ãä¸æ¸ããã¾ãã 2
å以ä¸æå®ãã¦ãæå³ã®ãããªãã·ã§ã³ã¯ã以ä¸ã®èª¬æã®ä¸‐
ã§è¨è¿°ããã¦ãã¾ãã

     ãªãã·ã§ã³å¼æ°ã§ã¯ãªããã®ã¯ãä¸ç·ã«ãªã³ã¯ããããªãã¸ã§ã¯ããã¡ã¤ã«ã
ã¢ã¼ã«ã¤ãã§ãã
ãããã¯ããªãã·ã§ã³ã¨ãã®ãªãã·ã§ã³ã®å¼æ°ã®éã«å¥ããªãéãã
ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã®åã«ç½®ãã¦ããå¾ãã«ç½®ãã¦ãã
æ··ãã¦æå®ãã¦ãæ§ãã¾ããã

     é常ããªã³ã«ã¯å°ãªãã¨ã 1 ã¤ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãæå®ãã¦
èµ·åããã¾ããã−l ã −R ãç¨ãã¦ãã¾ãã¯
ã¹ã¯ãªããã³ãã³ãè¨èªä½¿ã£ã¦ãä»ã®ãã¤ããªå½¢å¼ã®å¥åãã¡ã¤ã«ã
æå®ãããã¨ãã§ãã¾ãã ãã¤ããªå¥åãã¡ã¤ã«ãå¨ãæå®ãããªãã£ãå ´åã
ãªã³ã«ã¯ä½ãåºåããããNo input files ã¨ããã¡ãã»ã¼ã¸ãåºãã¾ãã

     ãªã³ã«ããªãã¸ã§ã¯ããã¡ã¤ã«ã®å½¢å¼ãèªèã§ããªãã£ãæã¯ã
ããããªã³ã«ã¹ã¯ãªããã¨ä»®å®ãã¾ãã
ãã®ããã«æå®ãããã¹ã¯ãªããã¯ããªã³ã¯ã«ä½¿ããã主ãªã³ã«ã¹ã¯ãªãã
(ããã©ã«ãã®ãªã³ã«ã¹ã¯ãªãããããã㯠−T ã§æå®ãããã¹ã¯ãªãã) ã«
追å ããã¾ãã
ãã®æ©è½ã«ãããä¸è¦ãªãã¸ã§ã¯ããã¡ã¤ã«ãããã¯ã¢ã¼ã«ã¤ãã«è¦ãããã
å®éã¯åã«ã·ã³ãã«å¤ãå®ç¾©ãã¦ããã ãã ã£ããã "INPUT" ã "GROUP"
ã使ã£ã¦ ä»ã®ãªãã¸ã§ã¯ããèª‐
ã¿è¾¼ãã§ãã ãã®ãã¡ã¤ã«ããªã³ã¯ãããã¨ãã§ãã¾ãã
ãã®ããã«æå®ãããã¹ã¯ãªããã¯ã主ãªã³ã«ã¹ã¯ãªããã«
åã«è¿½å ãããã ãã¨ãããã¨ã«æ³¨æãã¦ãã ããã
ããã©ã«ãã®ãªã³ã«ã¹ã¯ãªãããå®å¨ã«ç½®ãæããå ´åã¯ã −T
ãªãã·ã§ã³ã使ã£ã¦ãã ããã

     1 æåã®ååãæã¤ãªãã·ã§ã³ã®å¼æ°ã¯ãéã«ç©ºç½ãå¥ããã«
ãªãã·ã§ã³æåã«ç¶ããããã®å¼æ°ãå¿è¦ãªãªãã·ã§ã³ã®ããå¾ã«ã
ç¬ç«ããå¼æ°ã¨ãã¦ä¸ãããããããªããã°ãªãã¾ããã

     è¤æ°æåã®ååãæã¤ãªãã·ã§ã³ã¯ã 1 ã¤ãã¾ã㯠2 ã¤ã®ããã·ã¥ã®
ã©ã¡ãã®å¾ã«ç¶ãã¦ãæ§ãã¾ããã ä¾ãã°ã−trace−symbol ã¨
−−trace−symbol ã¯ç価ã§ãã ãã®ã«ã¼ã«ã«ã¯ 1
ã¤ã ãä¾å¤ããããã¨ã«æ³¨æãã¦ãã ããã å°æåã® ’o’ ã§å§ã¾ãè¤æ°æå‐
ã®ãªãã·ã§ã³ã¯ã 2 ã¤ã®ããã·ã¥ã®å¾ã«ããç¶ãã¾ããã ããã¯ã−o
ãªãã·ã§ã³ã¨ã®æ··ä¹±ãå°ãªãããããã§ãã ã§ããããä¾ãã° −omagic
ã¯åºåãã¡ã¤ã«åã magic ã¨ããã®ã«å¯¾ãã¦ã−−omagic ã¯åºåã« NMAGIC
ãã©ã°ãè¨å®ãã¾ãã

     è¤æ°æåã®ãªãã·ã§ã³ã¸ã®å¼æ°ã¯ãç‐
å·è¨å·ããªãã·ã§ã³ã¨ã®éã«å¥ããã
ãã®å¼æ°ãå¿è¦ã¨ãããªãã·ã§ã³ã®ããå¾ã«ã
ç¬ç«ããå¼æ°ã¨ãã¦ä¸ãããããããªããã°ãªãã¾ããã ä¾ãã°ã−−trace−symbol
foo 㨠−−trace−symbol=foo 㯠ç価ã§ãã è¤æ°æå‐
ã®ãªãã·ã§ã³ããä¸æã«å®ã¾ãããã«çç¥ãã¦ããåãä»ãããã¾ãã

     ãªã³ã«ãã³ã³ãã¤ã©ãã©ã¤ã (ä¾ãã° gcc) ã«ãã£ã¦éæ¥çã«
èµ·åãããå ´åããã¹ã¦ã®ãªã³ã«ã®ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã¯ã −Wl,
(ãããã¯ç¹å®ã®ã³ã³ãã¤ã©ãã©ã¤ãã®é©åãªãªãã·ã§ã³)









                             ‐3‐


ã«ç¶ãã¦ä»¥ä¸ã®ããã«æå®ãããªããã°ãªãã¾ãã:

               gcc ‐Wl,‐‐startgroup foo.o bar.o ‐Wl,‐‐endgroup

     ããã¯éè¦ã§ãã ã¨ããã®ãããã®ããã«ããªãã¨ãã³ã³ãã¤ã©ãã©ã¤ããã‐
ã°ã©ã 㯠ä½ãè¨ããã«ãªã³ã«ãªãã·ã§ã³ãè½ãã¦ãã¾ãããªã³ã¯ãæ£ãã
è¡ãããªããªã£ã¦ãã¾ãããã§ãã

     以ä¸ã¯ãGNU ãªã³ã«ãåãå¥ããä¸è¬çãªã³ãã³ãã©ã¤ã³ã¹ã¤ããã®
ä¸è¦§ã§ã:

−akeyword
    ãã®ãªãã·ã§ã³ã¯ãHP/UX ã¨ã®äºææ§ã®ããã«ãµãã¼ãããã¦ãã¾ãã
    keyword å¼æ°ã¯ãæåå archive, shared ã¾ã㯠default
    ã®ã©ããã§ãªããã°ãªãã¾ããã −aarchive ã¯ãæ©è½çã«ã¯ −Bstatic
    ã¨ç価ã§ããã æ®ãã® 2 ã¤ã® keyword ã¯ãæ©è½çã« −Bdynamic
    ã¨ç価ã§ãã ãã®ãªãã·ã§ã³ã¯ä½åº¦ã§ã使ããã¨ãã§ãã¾ãã

−Aarchitecture

−−architecture=architecture
    ç¾å¨ãªãªã¼ã¹ããã¦ãã ld ã§ã¯ããã®ãªãã·ã§ã³ã¯ Intel 960
    ãã¡ããªã®ã¢ã¼ããã¯ãã£ã§ã®ã¿ä½¿ããã¾ãã ãã®ãã㪠ld
    ã®æ§æã§ã¯ãarchitecture å¼æ°ã¯ã 960 ãã¡ããªã®ç¹å®ã®ã¢ã¼ã‐
    ãã¯ãã£ãæå®ããããã¤ãã®ä¿è·æ段ãæå¹ã«ãã
    ã¢ã¼ã«ã¤ãã©ã¤ãã©ãªã®æ¤ç´¢ãã¹ãä¿®æ£ãã¾ãã

    å°æ¥ã® ld ã®ãªãªã¼ã¹ã§ã¯ãä»ã®ã¢ã¼ããã¯ãã£ãã¡ããªã§ã
    åæ§ã®æ©è½ããµãã¼ãããããããã¾ããã

−b input‐format

−−format=input‐format
    ld ã¯ã1 種é¡ä»¥ä¸ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ããµãã¼ãããããã«
    æ§æãããã¨ãã§ãã¾ãã ãã ld ããã®ããã«æ§æããã¦ãããªãã−b
    ãªãã·ã§ã³ã§
    å¥åãããªãã¸ã§ã¯ããã¡ã¤ã«ã®ãã¤ããªå½¢å¼ãæå®ãããã¨ãã§ãã¾ãã
    ãã®å¥åãã¡ã¤ã«ã¯ãã³ãã³ãã©ã¤ã³ä¸ã§ãã®ãªãã·ã§ã³ã«ç¶ãã¦æå®ãã¾ãã
    ãã¨ã ld ããä»ã®ãªãã¸ã§ã¯ãå½¢å¼ããµãã¼ãããããã« è¨‐
    å®ããã¦ãã¦ããé常ãã®ãªãã·ã§ã³ãæå®ããå¿è¦ã¯ããã¾ããã
    ã¨ããã®ããld ã¯ããããããã·ã³ä¸ã§æãä¸è¬çãªå½¢å¼ã
    ããã©ã«ãã®å¥åå½¢å¼ã§ããã¨æå¾ããããè¨å®ããã¦ããããã§ãã input‐
    format ã¯ããã¹ãæååã§ãBFD ã©ã¤ãã©ãªã§
    ãµãã¼ãããã¦ããç¹å®ã®å½¢å¼åã§ã (objdump −i
    ã§ã使ç¨å¯è½ãªãã¤ããªå½¢å¼åã®ãªã¹ããå¾ããã¾ã)ã

    ãã¡ã¤ã«ãé常ã§ãªããã¤ããªå½¢å¼ã¨ãªã³ã¯ãããå ´åã«ã
    ãã®ãªãã·ã§ã³ã使ããã¨ãã§ãã¾ãã
    (ç°ãªãå½¢å¼ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ã¨ãªã³ã¯ããæã«) åæ§ã« −b
    ã§æ示çã«å½¢å¼ãåãæ¿ãããã¾ãã ãã®å ´å㯠−b input‐format
    ãç¹å®ã®å½¢å¼ã® ãªãã¸ã§ã¯ããã¡ã¤ã«ã®åã°ã«ã¼ãã®åã§æå®ãã¾ãã

    ããã©ã«ãã®å½¢å¼ã¯ãç°å¢å¤æ° "GNUTARGET" ãã åå¾ããã¾ãã










                             ‐4‐


    ã¹ã¯ãªããããå¥åå½¢å¼ãæå®ããäºãã§ãã ãã®å ´åã¯ã³ãã³ã "TARGET"
    ã使ãã¾ãã

−c MRI‐commandfile

−−mri−script=MRI‐commandfile
    MRI 製ã®ãªã³ã«ã¨ã®äºææ§ã®ãããld ã¯ã GNU ld ããã¥ã¡ã³ãã®
    MRI äºæã¹ã¯ãªãããã¡ã¤ã«ã®ç« ã«
    è¨è¿°ããã¦ããããä¸ã¤ã®å¶éãããã³ãã³ãè¨èªã§æ¸ããã
    ã¹ã¯ãªãããã¡ã¤ã«ãåãä»ãã¾ãã ãªãã·ã§ã³ −c 㧠MRI
    ã¹ã¯ãªãããã¡ã¤ã«ãå°å¥ããå ´åã¯ã −T
    ãªãã·ã§ã³ãç¨ãããã¨ã§ãæ±ç¨ç®çã® ld ã¹ã¯ãªããè¨èªã§
    æ¸ããããªã³ã«ã¹ã¯ãªãããèµ°ããããã¨ãã§ãã¾ãã MRI‐commandfile
    ããªãã£ãå ´åãld ã¯ã−L ã§æå®ããã ãã¹ã¦ã®ãã£ã¬ã¯ããªãæ¢ãã¾ãã

−d

−dc

−dp ãããã® 3 ã¤ã®ãªãã·ã§ã³ã¯ç価ã§ãã
    ä»ã®ãªã³ã«ã¨ã®äºææ§ã®ããã«è¤æ°ã®å½¢å¼ããµãã¼ãããã¦ãã¾ãã
    åéç½®å¯è½ãªãã¡ã¤ã«ãåºåããããã« (−r ã«ãã£ã¦)
    æå®ãããå ´åã§ããã³ã¢ã³ã·ã³ãã«ã«ç©ºéãå²ãå½ã¦ã¾ãã
    ã¹ã¯ãªããã³ãã³ãã® "FORCE_COMMON_ALLOCATION" ã
    åãå¹æãæã¡ã¾ãã

−e entry

−−entry=entry
    ããã°ã©ã ã®å®è¡éå§ç¹ã示ãæ示çãªã·ã³ãã«ã¨ãã¦ã
    ããã©ã«ãã®ã¨ã³ããªãã¤ã³ãã®ä»£ããã« entry ã使ç¨ãã¾ãã
    ã·ã³ãã« entry ããªãã£ãå ´åããªã³ã«ã¯ entry ã æ°å‐
    ã¨ãã¦è§£éãããã¨è©¦ã¿ããããéå§çªå°ã¨ãã¦ä½¿ãã¾ã (æ°åã¯åºæ°ã
    10 ã¨ãã¦è§£éããã¾ãã åé ã«ã¤ãã 0x 㯠16
    ãåºæ°ã¨ãããã¨ã表ãã0 㯠8 ãåºæ°ã¨ãããã¨ã表ãã¾ã)ã

−E

−−export−dynamic
    åçã«ãªã³ã¯ãããå®è¡ãã¡ã¤ã«ãä½æããæã«ããã¹ã¦ã®ã·ã³ãã«ã
    åçã·ã³ãã«ãã¼ãã«ã«å ãã¾ãã
    åçã·ã³ãã«ãã¼ãã«ã¯ãå®è¡æã«åçãªãã¸ã§ã¯ãããè¦ããã·ã³ãã«ã®
    ãã¼ãã«ã§ãã

    ãããã®ãªãã·ã§ã³ã使ç¨ããªãã£ãå ´åãé常ã
    åçã·ã³ãã«ãã¼ãã«ã«ã¯ããªã³ã¯ä¸ã«æå®ãããããã¤ãã®
    åçãªãã¸ã§ã¯ãããåç§ãããã·ã³ãã«ã®ã¿ãå«ã¾ãã¾ãã

    ä»ã®åçãªãã¸ã§ã¯ãã§ã¯ãªãããã®ããã°ã©ã ã§å®ç¾©ããã¦ããã·ã³ãã«ã
    åç§ãè¿ãå¿è¦ã®ããåçãªãã¸ã§ã¯ãã "dlopen" 㧠ã‐
    ã¼ãããå ´åã¯ãããããããã°ã©ã èªèº«ããªã³ã¯ããæã«ãã®ãªãã·ã§ã³ã
    使ãå¿è¦ãããã§ãããã

    åºåå½¢å¼ããµãã¼ããã¦ããå ´åããã¼ã¸ã§ã³ã¹ã¯ãªããã使ã£ã¦ã









                             ‐5‐


    ã©ã®ã·ã³ãã«ãåçã·ã³ãã«ãã¼ãã«ã«è¿½å ãã¹ãããå¶å¾¡ã§ãã¾ãã
    @ref{VERSION} ä¸ã® −−version−script ã®è¨è¿°ã
    åç§ãã¦ãã ããã

−EB ããã°ã¨ã³ãã£ã¢ã³ã®ãªãã¸ã§ã¯ãããªã³ã¯ãã¾ãã
    ããã¯ããã©ã«ãã®åºåå½¢å¼ã«å½±é¿ãã¾ãã

−EL ãªãã«ã¨ã³ãã£ã¢ã³ã®ãªãã¸ã§ã¯ãããªã³ã¯ãã¾ãã
    ããã¯ããã©ã«ãã®åºåå½¢å¼ã«å½±é¿ãã¾ãã

−f

−−auxiliary name
    ELF ã®å±æãªãã¸ã§ã¯ããçæããéã«ãåé¨ã® DT_AUXILIARY
    ãã£ã¼ã«ãã«ãæå®ãã name ãè¨å®ãã¾ãã
    ããã¯ãå±æãªãã¸ã§ã¯ãã®ã·ã³ãã«ãã¼ãã«ããå±æãªãã¸ã§ã¯ã name
    ã®ã·ã³ãã«ãã¼ãã«ã«é©ç¨ããè£å©ã®ãã£ã«ã¿ã¨ãã¦ä½¿ãäºãã
    åçãªã³ã«ã«å¯¾ãã¦æ示ãã¾ãã

    å¾ãããã®ãã£ã«ã¿ãªãã¸ã§ã¯ãã«å¯¾ãã¦ããã°ã©ã ããªã³ã¯ããå ´åã
    ãã®ããã°ã©ã ãå®è¡ããæã«ãåçãªã³ã«ã¯ DT_AUXILIARY
    ãã£ã¼ã«ããè¦ã¾ãã
    åçãªã³ã«ããã£ã«ã¿ãªãã¸ã§ã¯ãããã®ã·ã³ãã«ã解決ããå ´åã¯ã
    å±æãªãã¸ã§ã¯ã name ã®ä¸ã«å®ç¾©ããããã©ãããã¾ããã§ãã¯ãã¾ãã
    ããããããã£ãå ´åã¯ããã£ã«ã¿ãªãã¸ã§ã¯ãä¸‐
    ã®å®ç¾©ã®ä»£ããã«ä½¿ç¨ããã¾ãã å±æãªãã¸ã§ã¯ã name ã¯ãå‐
    å¨ããªãã¦ãæ§ãã¾ããã ãã®ããã«ãã¦å±æãªãã¸ã§ã¯ã name
    ã¯ããããããããã®ã³ã°ã
    ãã·ã³ç¹æã®ããã©ã¼ãã³ã¹ã¨ãã£ãããæ©è½ã®å¥ã®å®è£ãæä¾ããããã«
    使ç¨ã§ãã¾ãã

    ãã®ãªãã·ã§ã³ã¯ 2 å以ä¸æå®ããã¦ãæ§ãã¾ããã DT_AUXILIARY
    ã¨ã³ããªã¯ãã³ãã³ãã©ã¤ã³ã«ç¾ããé çªã«çæããã¾ãã

−F name

−−filter name
    ELF ã®å±æãªãã¸ã§ã¯ããçæããéã«ãåé¨ã® DT_FILTER
    ãã£ã¼ã«ãã«ãæå®ãã name ãè¨å®ãã¾ãã
    ããã¯ãå±æãªãã¸ã§ã¯ãã®ã·ã³ãã«ãã¼ãã«ããå±æãªãã¸ã§ã¯ã name
    ã®ã·ã³ãã«ãã¼ãã«ã«é©ç¨ãããã£ã«ã¿ã¨ãã¦ä½¿ãäºãã
    åçãªã³ã«ã«å¯¾ãã¦æ示ãã¾ãã

    å¾ãããã®ãã£ã«ã¿ãªãã¸ã§ã¯ãã«å¯¾ãã¦ããã°ã©ã ããªã³ã¯ããå ´åã
    ãã®ããã°ã©ã ãå®è¡ããæã«ãåçãªã³ã«ã¯ DT_FILTER
    ãã£ã¼ã«ããè¦ã¾ãã
    åçãªã³ã«ã¯ãé常ã®ããã«ãã£ã«ã¿ãªãã¸ã§ã¯ãã®ã·ã³ãã«ãã¼ãã«ã«å¾ã£ã¦
    ã·ã³ãã«ã解決ãã¾ãããå®éã«ã¯å±æãªãã¸ã§ã¯ã name ä¸‐
    ã«è¦ã¤ãã£ã å®ç¾©ã«ãªã³ã¯ãã¾ãã
    ãã®ããã«ãã¦ãã£ã«ã¿ãªãã¸ã§ã¯ãã¯ããªãã¸ã§ã¯ã name ã«ãã£ã¦
    æä¾ãããã·ã³ãã«ã®ãµãã»ãããé¸æããã®ã«ä½¿ç¨ã§ãã¾ãã

    ããã¤ãã®å¤ããªã³ã«ã¯ãã³ã³ãã¤ã«ãã¼ã«ãã§ã¼ã³ãéãã¦ã −F
    ãªãã·ã§ã³ããå¥åããã³åºåãªãã¸ã§ã¯ããã¡ã¤ã«ä¸¡æ¹ã®å½¢å¼ã









                             ‐6‐


    æå®ããããã«ä½¿ã£ã¦ãã¾ããã GNU
    ãªã³ã«ã¯ããã®ç®çã«å¥ã®ã¡ã«ããºã ãç¨ãã¦ãã¾ãã ãã㯠−b,
    −−format, −−oformat ãªãã·ã§ã³ãã ãªã³ã«ã¹ã¯ãªããä¸ã®
    "TARGET" ã³ãã³ãã ãã㦠"GNUTARGET" ç°å¢å¤æ°ã§ãã GNU
    ãªã³ã«ã¯ãELF å±æãªãã¸ã§ã¯ããä½ããªãæã«ã¯ã −F
    ãªãã·ã§ã³ãç¡è¦ãã¾ãã

−fini name
    ELF ã®å®è¡å½¢å¼ãããã¯å±æãªãã¸ã§ã¯ããçæããéã é¢æ°ã®ã¢ãã¬ã¹ã«
    DT_FINI ãè¨å®ãããã¨ã«ããã
    å®è¡å½¢å¼ãããã¯å±æãªãã¸ã§ã¯ããã¢ã³ãã¼ããããæã« NAME
    ãå¼ã³ã¾ãã ããã©ã«ãã§ã¯ããªã³ã«ã¯ "_fini"
    ããå¼ã¶ã¹ãé¢æ°ã¨ã㦠使ç¨ãã¾ãã

−g  ç¡è¦ããã¾ãã ããã¯ä»ã®ãã¼ã«ã¨ã®äºææ§ã®ããã«æä¾ããã¦ãã¾ãã

−Gvalue

−−gpsize=value
    GP ã¬ã¸ã¹ã¿ã使ç¨ãã¦æé©åããããªãã¸ã§ã¯ãã®æ大ãµã¤ãºã size
    ã«è¨å®ãã¾ãã
    ããã¯ã大ãããªãã¸ã§ã¯ãã¨å°ãããªãã¸ã§ã¯ããç°ãªãã»ã¯ã·ã§ã³ã«
    éç½®ãããã¨ããµãã¼ããã¦ãã MIPS ECOFF ã®ãããª
    ãªãã¸ã§ã¯ããã¡ã¤ã«å½¢å¼ã®å ´åã®ã¿æå³ãæã¡ã¾ãã
    ä»ã®ãªãã¸ã§ã¯ããã¡ã¤ã«å½¢å¼ã®å ´åã¯ç¡è¦ããã¾ãã

−hname

−soname=name
    ELF ã®å±æãªãã¸ã§ã¯ããçæããéã«ãåé¨ã® DT_SONAME
    ãã£ã¼ã«ãã«ãæå®ãã name ãè¨å®ãã¾ãã å®è¡å½¢å¼ã DT_SONAME
    ãã£ã¼ã«ããæã¤å±æãªãã¸ã§ã¯ãã¨
    ãªã³ã¯ãããã¨ãå®è¡å½¢å¼ãå®è¡ãããæã«ãåçãªã³ã«ã¯
    ãªã³ã«ã«ä¸ãããããã¡ã¤ã«åã使ã代ããã« DT_SONAME ãã£ã¼ã«ãã§
    æå®ãããå±æãªãã¸ã§ã¯ãããã¼ããããã¨ãã¾ãã

−i  ã¤ã³ã¯ãªã¡ã³ã¿ã«ãªã³ã¯ãè¡ãã¾ã (ãªãã·ã§ã³ −r ã¨åãã§ã)ã

−init name
    ELF ã®å®è¡å½¢å¼ãããã¯å±æãªãã¸ã§ã¯ããçæããéã é¢æ°ã®ã¢ãã¬ã¹ã«
    DT_INIT ãè¨å®ãããã¨ã«ããã å®è¡å½¢å¼ãããã¯å±æãªãã¸ã§ã¯ããã‐
    ã¼ããããæã« NAME ãå¼ã³ã¾ãã ããã©ã«ãã§ã¯ããªã³ã«ã¯ "_init"
    ããå¼ã¶ã¹ãé¢æ°ã¨ã㦠使ç¨ãã¾ãã

−larchive

−−library=archive
    ã¢ã¼ã«ã¤ããã¡ã¤ã« archive ãããªã³ã¯ãã¹ããã¡ã¤ã«ã®ãªã¹ãã«
    追å ãã¾ãã ãã®ãªãã·ã§ã³ã¯ãä½åº¦æå®ãã¦ãæ§ãã¾ããã ld
    ã¯ãarchive ãæå®ããããã³ã« "libarchive.a"
    ãèªèº«ã®ãã¹ãªã¹ãããæ¢ãã¾ãã

    å±æã©ã¤ãã©ãªããµãã¼ãããã·ã¹ãã ã§ã¯ãld ã¯ã".a"
    以å¤ã®ãµãã£ãã¯ã¹ãæã¤ã©ã¤ãã©ãªãæ¢ããã¨ãããã¾ãã ç¹ã« ELF ã









                             ‐7‐


    SunOS ã·ã¹ãã ã§ã¯ãld ã¯ã".a"
    ã¨ãããµãã£ãã¯ã¹ãæã¤ã©ã¤ãã©ãªãæ¢ãåã«ã".so" ã¨ãã
    ãµãã£ãã¯ã¹ãæã¤ã©ã¤ãã©ãªããã£ã¬ã¯ããªããæ¢ãã¾ãã
    æ£ç¿ã«ããã".so" ãµãã£ãã¯ã¹ã¯å±æã©ã¤ãã©ãªã示ãã¾ãã

    ãªã³ã«ã¯ãã³ãã³ãã©ã¤ã³ã§æå®ããããã®å ´æã§ã®ã¿ã 1
    åã ãã¢ã¼ã«ã¤ããæ¤ç´¢ãã¾ãã
    ãããã®ã¢ã¼ã«ã¤ãããããã¾ã§ã«ã³ãã³ãã©ã¤ã³ã«ç¾ãããªãã¸ã§ã¯ãã§ã¯
    å®ç¾©ãã¦ããªãã·ã³ãã«ãå®ç¾©ãã¦ããæã¯ããªã³ã«ã¯ããã®ã¢ã¼ã«ã¤ããã
    é©åãªãã¡ã¤ã«ãåãè¾¼ã¿ã¾ãã
    ããããã³ãã³ãã©ã¤ã³ã«å¾ããç¾ãããªãã¸ã§ã¯ãã«å«ã¾ãã
    æªå®ç¾©ã·ã³ãã«ã«ãã£ã¦ããªã³ã«ãã¢ã¼ã«ã¤ããå度æ¤ç´¢ãããã¨ã¯ããã¾ããã

    ã¢ã¼ã«ã¤ããè¤æ°åæ¤ç´¢ãããããªã³ã«ã«å¼·å¶ããæ¹æ³ã¯ã −(
    ãªãã·ã§ã³ãåç§ãã¦ãã ããã

    åãã¢ã¼ã«ã¤ããã³ãã³ãã©ã¤ã³ä¸ã«è¤æ°åæå®ãã¦ãæ§ãã¾ããã

    ãã®ç¨®ã®ã¢ã¼ã«ã¤ãæ¤ç´¢ã¯ãUnix ã®ãªã³ã«ã§ã¯æ®éã§ãã ããã
    AIX ä¸ã§ ld ã使ç¨ããå ´åãAIX ãªã³ã«ã¨ã¯
    ç°ãªã£ãåä½ãããã®ã§æ³¨æãå¿è¦ã§ãã

−Lsearchdir

−−library−path=searchdir
    ãã¹ searchdir ããld ãã¢ã¼ã«ã¤ãã©ã¤ãã©ãªã ld ã®
    å¶å¾¡ã¹ã¯ãªãããæ¤ç´¢ããã®ã«ä½¿ç¨ãããã¹ã®ãªã¹ãã«è¿½å ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãä½åº¦æå®ãã¦ãæ§ãã¾ããã
    ãã£ã¬ã¯ããªã¯ãã³ãã³ãã©ã¤ã³ä¸ã§æå®ãããé ã«æ¤ç´¢ããã¾ãã
    ã³ãã³ãã©ã¤ã³ä¸ã§æå®ããããã£ã¬ã¯ããªã¯ãããã©ã«ãã®ãã£ã¬ã¯ããªã®
    åã«æ¤ç´¢ããã¾ãã ãã¹ã¦ã® −L
    ãªãã·ã§ã³ã¯ããªãã·ã§ã³ã®åºç¾ããé çªã«ãããã ãã¹ã¦ã® −l
    ãªãã·ã§ã³ã«é©ç¨ããã¾ãã

    searchdir ã "=" ã§å§ã¾ãå ´åã "=" 㯠sysroot prefix
    (ãªã³ã«ãæ§æãããéã«æå®ããããã¹) ã«ããç½®ãæãããã¾ãã

    (−L ã§æå®ãããªã) ããã©ã«ãã®æ¤ç´¢ãã¹ã®çµã¯ã ld
    ãã©ã®ã¨ãã¥ã¬ã¼ã·ã§ã³ã¢ã¼ãã使ã£ã¦ãããã
    ããã¦å ´åã«ãã£ã¦ã¯ã©ã®ããã«æ§æããããã«ä¾åãã¾ãã

    ãã¹ã¯ããªã³ã¯ã¹ã¯ãªããä¸ã§ "SEARCH_DIR"
    ã³ãã³ããç¨ãã¦ãæå®ã§ãã¾ãã
    ãã®æ¹æ³ã§æå®ããããã£ã¬ã¯ããªã¯ãã³ãã³ãã©ã¤ã³ä¸ã§ãªã³ã«ã¹ã¯ãªããã
    ç¾ããæç¹ã§æ¤ç´¢ããã¾ãã

−memulation
    emulation ãªã³ã«ãã¨ãã¥ã¬ã¼ããã¾ãã −−verbose ã −V
    ãªãã·ã§ã³ã§ãå©ç¨å¯è½ãªã¨ãã¥ã¬ã¼ã·ã§ã³ã ãªã¹ãã§ãã¾ãã

    −m ãªãã·ã§ã³ãæå®ããã¦ããªãå ´åãã¨ãã¥ã¬ã¼ã·ã§ã³ã¯ã
    "LDEMULATION" ç°å¢å¤æ°ãå®ç¾©ããã¦ããã° ããããåå¾ããã¾ãã

    ãã以å¤ã®å ´åãããã©ã«ãã®ã¨ãã¥ã¬ã¼ã·ã§ã³ã¯ããªã³ã«ãã©ã®ããã«









                             ‐8‐


    æ§æããããã«ä¾åãã¾ãã

−M

−−print−map
    ãªã³ã¯ããããæ¨æºåºåã«è¡¨ç¤ºãã¾ãã
    ãªã³ã¯ãããã¯ã以ä¸ãå«ããªã³ã¯ã®æå ±ãæä¾ãã¾ã:

    *   ãªãã¸ã§ã¯ããã¡ã¤ã«ã¨ã·ã³ãã«ããã¡ã¢ãªã®ã©ãã«ãããããããã

    *   ã³ã¢ã³ã·ã³ãã«ãã©ã®ããã«å²ãå½ã¦ããããã

    *   ãªã³ã¯ã«å«ã¾ãããã¹ã¦ã®ã¢ã¼ã«ã¤ãã¡ã³ããããã³
        ãã®ã¢ã¼ã«ã¤ãã¡ã³ããåãè¾¼ããã£ããã¨ãªã£ãã·ã³ãã«ã

−n

−−nmagic
    ã»ã¯ã·ã§ã³ã®ãã¼ã¸ã¢ã©ã¤ã³ã¡ã³ããç¡å¹ã«ããå¯è½ã§ããã° åºåã«
    "NMAGIC" ã¨å°ãä»ãã¾ãã

−N

−−omagic
    ããã¹ãã»ã¯ã·ã§ã³ã¨ãã¼ã¿ã»ã¯ã·ã§ã³ãèªã¿æ¸ãå¯è½ã«è¨å®ãã¾ãã
    ã¾ãããã¼ã¿ã»ã°ã¡ã³ãã®ãã¼ã¸ã¢ã©ã¤ã³ã¡ã³ããè¡ãã¾ããã
    å±æã©ã¤ãã©ãªã¨ã®ãªã³ã¯ãã§ããªããªãã¾ãã åºåå½¢å¼ã Unix
    å½¢å¼ã®ãã¸ãã¯ãã³ãããµãã¼ããã¦ããå ´åã åºåã« "OMAGIC"
    ã¨å°ãä»ãã¾ãã 注æ: PE‐COFF
    ã¿ã¼ã²ããã«å¯¾ãã¦ãæ¸ãè¾¼ã¿å¯è½ãªããã¹ãã»ã¯ã·ã§ã³ã¯
    許ããã¦ãã¾ããããã㯠Microsoft ãçºè¡ãã¦ããå½¢å¼ä»æ§ã«ã¯
    é©åãã¦ãã¾ããã

−−no−omagic
    ãã®ãªãã·ã§ã³ã¯ã−N ãªãã·ã§ã³ã®æã¤å¹æã®ã»ã¨ãã©ãå¦å®ãã¾ãã
    ããã¹ãã»ã°ã¡ã³ããèªã¿è¾¼ã¿å°ç¨ã¨ãããã¼ã¿ã»ã°ã¡ã³ããå¼·å¶çã«
    ãã¼ã¸ã¢ã©ã¤ã³ã¡ã³ããã¾ãã
    ãã®ãªãã·ã§ã³ã¯å±æã©ã¤ãã©ãªã¨ã®ãªã³ã¯ã
    æå¹ã«ããªããã¨ã«æ³¨æãã¦ä¸ããã
    å±æã©ã¤ãã©ãªã¨ã®ãªã³ã¯ã®ããã«ã¯ã −Bdynamic ã使ç¨ãã¦ä¸ããã

−o output

−−output=output
    output ããld ã«ãã£ã¦çæãããããã°ã©ã ã® ååã¨ãã¦ä½¿ç¨ãã¾ãã
    ãã®ãªãã·ã§ã³ãæå®ãããªãã£ãå ´åãa.out ã¨ããååã
    ããã©ã«ãã§ä½¿ç¨ããã¾ãã ã¹ã¯ãªããã³ãã³ãã® "OUTPUT" ã«ãã£ã¦ãã
    åºåãã¡ã¤ã«åãæå®ãããã¨ãã§ãã¾ãã

−O level
    level ã 0 ãã大ããæ°å¤ã§ãã£ãå ´åã ld ã¯åºåãæé©åãã¾ãã
    ããã«ã¯ã¨ã¦ãé·ãæéããããã¾ãã®ã§ãæçµçãªãã¤ããªã®ä½ææã®ã¿
    æå¹ã«ããã¹ãã§ãããã










                             ‐9‐


−q

−−emit−relocs
    æçµçã«ãªã³ã¯ãããå®è¡å½¢å¼ä¸‐
    ã«ãåéç½®ã»ã¯ã·ã§ã³ã¨å容ãæ®ãã¾ãã
    ãããã®æå ±ã¯ããªã³ã¯å¾ã®åæã»æé©åãã¼ã«ãå®è¡å½¢å¼ãæ‐
    £ããå¤æ´ããã®ã« å¿è¦ã¨ãªãã§ãããã
    ããã¯ããã大ããªå®è¡å½¢å¼ãçæãã¾ãã

    ãã®ãªãã·ã§ã³ã¯ãç¾å¨ ELF ãã©ãããã©ã¼ã ã§ãã
    ãµãã¼ãããã¦ãã¾ããã

−r

−−relocatable
    åéç½®å¯è½ãªåºåãçæãã¾ãã ã¤ã¾ããld
    ã¸ã®å¥åã¨ãã¦å©ç¨ã§ããåºåãã¡ã¤ã«ãçæãã¾ãã ããã¯ãã é¨åãªã³ã¯
    ã¨å¼ã°ãã¾ãã ãã®å¯ä½ç¨ã¨ãã¦ãUnix
    ã®æ¨æºã®ãã¸ãã¯ãã³ãããµãã¼ãããç°å¢ã§ã¯ã
    ãã®ãªãã·ã§ã³ã¯åºåãã¡ã¤ã«ã®ãã¸ãã¯ãã³ãã "OMAGIC" ã«è¨‐
    å®ãã¾ãã ãã®ãªãã·ã§ã³ãæå®ãããªãã£ãå ´åã¯ã
    絶対ã¢ãã¬ã¹å¤ãç¨ãããã¡ã¤ã«ãçæããã¾ãã C++ ãã‐
    ã°ã©ã ããªã³ã¯ããå ´åã
    ãã®ãªãã·ã§ã³ã¯ã³ã³ã¹ãã©ã¯ã¿ã¸ã®åç§ã解決ãã¾ããã
    ãã®ãããªå ´å㯠−Ur ã使ç¨ãã¦ãã ããã

    å¥åãã¡ã¤ã«ãåºåãã¡ã¤ã«ã¨åãå½¢å¼ã§ã¯ãªãå ´åã
    é¨åãªã³ã¯ã¯ãå¥åãã¡ã¤ã«ãåéç½®ã»ã¯ã·ã§ã³ãå¨ãæããªãæã®ã¿
    ãµãã¼ãããã¾ãã ç°ãªã£ãåºåå½¢å¼ã¯ããããªãå¶éãæã¤ãã¨ãããã¾ãã
    ä¾ãã°ããã "a.out" ãã¼ã¹ã®å½¢å¼ã¯ã
    å¥åãã¡ã¤ã«ãç°ãªã£ãå½¢å¼ã§ãã£ãæã«ã¯ãé¨åãªã³ã¯ãå¨ããµãã¼ããã¾ããã

    ãã®ãªãã·ã§ã³ã¯ã−i ã¨åãã§ãã

−R filename

−−just−symbols=filename
    ã·ã³ãã«åããã®ã¢ãã¬ã¹ã filename ããèªã¿è¾¼ã¿ã¾ããã
    ãããåéç½®ãããåºåã«å«ãããã¨ã¯ãã¾ããã
    ããã«ãããåºåãã¡ã¤ã«ãä»ã®ãã‐
    ã°ã©ã ã§å®ç¾©ãããã¡ã¢ãªã®çµ¶å¯¾ä½ç½®ã
    ã·ã³ãã«ã§åç§ã§ããããã«ãªãã¾ãã ãã®ãªãã·ã§ã³ã¯ 2
    å以ä¸ä½¿ã£ã¦æ§ãã¾ããã

    ä»ã® ELF ãªã³ã«ã¨ã®äºææ§ã®ããã−R ãªãã·ã§ã³ã®å¾ã«
    ãã¡ã¤ã«åã§ã¯ãªããã£ã¬ã¯ããªåãç¶ããå ´åã −rpath
    ãªãã·ã§ã³ã¨ãã¦æ±ããã¾ãã

−s

−−strip−all
    ãã¹ã¦ã®ã·ã³ãã«æå ±ãåºåãã¡ã¤ã«ããåé¤ãã¾ãã











                            ‐10‐


−S

−−strip−debug
    (ãã¹ã¦ã®ã·ã³ãã«ã§ã¯ãªã) ãã¹ã¦ã®ãããã°ç¨ã·ã³ãã«æå ±ã
    åºåãã¡ã¤ã«ããåé¤ãã¾ãã

−t

−−trace
    ld ãå¥åãã¡ã¤ã«ãå¦çãããã³ã«ãå¥åãã¡ã¤ã«åã表示ãã¾ãã

−T scriptfile

−−script=scriptfile
    scriptfile ããªã³ã«ã¹ã¯ãªããã¨ãã¦ä½¿ç¨ãã¾ãã
    ãã®ã¹ã¯ãªããã¯ã(追å ãããã®ã§ã¯ãªã) ld ã®ããã©ã«ãã®
    ãªã³ã«ã¹ã¯ãªãããç½®ãæãã¾ãã ãããã£ã¦ãscriptfile
    ã«ã¯ãåºåãã¡ã¤ã«ãè¨è¿°ããã®ã«å¿è¦ãª
    ãã¹ã¦ã®ãã¨ãæå®ããªããã°ãªãã¾ããã scriptfile
    ãã«ã¬ã³ããã£ã¬ã¯ããªã«åå¨ããªãå ´åã "ld" ã¯ããã¹ã¦ã® −L
    ãªãã·ã§ã³ã«ç¶ã㦠æå®ããããã£ã¬ã¯ããªãæ¤ç´¢ãã¾ãã è¤æ°ã® −T
    ãªãã·ã§ã³ã¯ãä¸ã¤ã«ã¾ã¨ãããã¾ãã

−u symbol

−−undefined=symbol
    å¼·å¶çã« symbol ãæªå®ç¾©ã·ã³ãã«ã¨ãã¦åºåãã¡ã¤ã«ã«å«ãã¾ãã
    ãããããã¨ã«ãã£ã¦ãä¾ãã°æ¨æºã©ã¤ãã©ãªããããã«ã¢ã¸ã¥ã¼ã«ã
    ãªã³ã¯ããå¼ãéã¨ãããã¨ãã§ãã¾ãã ç°ãªããªãã·ã§ã³å¼æ°ãæã¤ãã¨ã§
    −u ãç¹°è¿ãæå®ãããã¨ãã§ãã æªå®ç¾©ã·ã³ãã«ã追å ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ã"EXTERN" ãªã³ã«ã¹ã¯ãªããã³ãã³ã㨠åãã§ãã

−Ur C++ ããã°ã©ã 以å¤ã«å¯¾ãã¦ã¯ããã®ãªãã·ã§ã³ã¯ −r ã¨åãã§ãã
    åéç½®å¯è½ãªåºåãã¤ã¾ã ld ã«å度å¥åå¯è½ãªåºåãã¡ã¤ã«ã
    çæãã¾ãã C++ ããã°ã©ã ããªã³ã¯ããå ´åã−r ã¨ã¯ç°ãªãã −Ur
    ã¯ã³ã³ã¹ãã©ã¯ã¿ã¸ã®åç§ã解決ãã¾ãã −Ur
    ã使ç¨ãã¦ãªã³ã¯ããããã¡ã¤ã«ã«å¯¾ãã¦ã¯ã −Ur ã使ç¨ã§ãã¾ããã
    ã³ã³ã¹ãã©ã¯ã¿ã®ãã¼ãã«ãä¸åº¦çæãããã¨ã追å ãããã¨ãã§ããªãã®ã§ãã
    −Ur ã¯ãæå¾ã®é¨åãªã³ã¯ã®ã¿ã«ä½¿ç¨ããããã«ãã¦ã ãã®ä»ã®å ´åã¯
    −r ã使ç¨ãã¦ãã ããã

−−unique[=SECTION]
    SECTION ã«ä¸è´ããå¥åã»ã¯ã·ã§ã³ãã¨ã«ã
    åå¥ã®åºåã»ã¯ã·ã§ã³ãçæãã¾ãã ãªãã·ã§ã³ã®ã¯ã¤ã«ãã«ã¼ã
    SECTION å¼æ°ããªãå ´åã¯ã
    親ãªãå¥åã»ã¯ã·ã§ã³ãã¨ã«ãåå¥ã®åºåã»ã¯ã·ã§ã³ãçæãã¾ãã
    親ãªãã»ã¯ã·ã§ã³ã¨ã¯ããªã³ã«ã¹ã¯ãªããä¸ã«
    æ示çã«è¨è¿°ããã¦ããªãã»ã¯ã·ã§ã³ã§ãã
    ãã®ãªãã·ã§ã³ã¯ãã³ãã³ãã©ã¤ã³ä¸ã§è¤æ°å使ç¨ã§ãã¾ãã
    ããã«ãã£ã¦ãé常ã®ååã®å¥åã»ã¯ã·ã§ã³ã®ãã¼ã¸ãè¡ããªãããã«ãã¾ãã
    ããã¯ããªã³ã«ã¹ã¯ãªããä¸‐
    ã§ã®åºåã»ã¯ã·ã§ã³ã®å²ãå½ã¦ãä¸æ¸ããã¾ãã











                            ‐11‐


−v

−−version

−V  ld ã®ãã¼ã¸ã§ã³çªå·ã表示ãã¾ãã −V
    ãªãã·ã§ã³ã¯ããµãã¼ããã¦ããã¨ãã¥ã¬ã¼ã¿ã®ä¸è¦§ã表示ãã¾ãã

−x

−−discard−all
    ãã¹ã¦ã®ãã¼ã«ã«ã·ã³ãã«ãåé¤ãã¾ãã

−X

−−discard−locals
    ãã¹ã¦ã®ä¸æçãªãã¼ã«ã«ã·ã³ãã«ãåé¤ãã¾ãã
    ã»ã¨ãã©ã®ã¿ã¼ã²ããã«ããã¦ãããã¯ååã L ã§å§ã¾ã ãã¹ã¦ã®ã‐
    ã¼ã«ã«ã·ã³ãã«ã§ãã

−y symbol

−−trace−symbol=symbol
    ãªã³ã¯ããããã¡ã¤ã«ã®ãã¡ãsymbol ãç¾ãããã¡ã¤ã«åã表示ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ä½åº¦ã§ãæå®ã§ãã¾ãã
    å¤ãã®ã·ã¹ãã ä¸ã§ã¯ãã·ã³ãã«åã®åã«ã¢ã³ãã¹ã³ã¢ã
    ã¤ããå¿è¦ãããã§ãããã

    ãã®ãªãã·ã§ã³ã¯ããªã³ã¯ä¸ã«æªå®ç¾©ã·ã³ãã«ãçºè¦ããããã
    ãããã©ãããåç§ããã¦ããã®ããããããªãå ´åã«å½¹ã«ç«ã¡ã¾ãã

−Y path
    ããã©ã«ãã®ã©ã¤ãã©ãªæ¤ç´¢ãã¹ã« path ã追å ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãSolaris ã¨ã®äºææ§ã®ããã«åå¨ãã¾ãã

−z keyword
    èªèããããã¼ã¯ã¼ãã¯æ¬¡ã®ã¨ããã§ãã

    combreloc
        è¤æ°ã®åéç½®ã»ã¯ã·ã§ã³ãçµåããåçã·ã³ãã«æ¤ç´¢ã‐
        ã£ãã·ã¥å¦çã å¯è½ã«ãã¾ãã

    defs
        ãªãã¸ã§ã¯ããã¡ã¤ã«ä¸ã®æªå®ç¾©ã·ã³ãã«ã許ãã¾ããã
        å±æã©ã¤ãã©ãªä¸ã®æªå®ç¾©ã·ã³ãã«ã¯è¨±ããã¾ãã

    initfirst
        ãã®ãªãã·ã§ã³ã¯å±æãªãã¸ã§ã¯ããæ§ç¯ãã¦ããã¨ãã«ã®ã¿æå³ãããã¾ãã
        ãªãã¸ã§ã¯ãã«å°ãä»ãããã®ãªãã¸ã§ã¯ãã®å®è¡æåæåå¦çãã
        ä»ã®ãã¹ã¦ã®ãªãã¸ã§ã¯ããããã»ã¹ã«å°å¥ãããããåã«ã
        åæã«çããããã«ãã¾ãã åæ§ã«ããã®ãªãã¸ã§ã¯ãã®å®è¡æçµäºå¦çãã
        ä»ã®ãã¹ã¦ã®ãªãã¸ã§ã¯ãã®å®è¡æçµäºå¦çãçµã£ãå¾ã«
        çããããã«ãã¾ãã











                            ‐12‐


    interpose
        ã·ã³ãã«ãã¼ãã«ã主å®è¡å½¢å¼ä»¥å¤ã®ãã¹ã¦ã®ã·ã³ãã«ã®åã«æ¿å¥ãããããã«ã
        ãªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

    loadfltr
        ãã£ã«ã¿ãå®è¡æã«ç´ã¡ã«å¦çãããããã«ããªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

    muldefs
        è¤æ°åã®å®ç¾©ã許å¯ãã¾ãã

    nocombreloc
        è¤æ°ã®åéç½®ã»ã¯ã·ã§ã³ã®çµåãç¡å¹ã«ãã¾ãã

    nocopyreloc
        åéç½®ã»ã¯ã·ã§ã³ã®è¤è£½çæãç¡å¹ã«ãã¾ãã

    nodefaultlib
        ä¾åé¢ä¿æ¤ç´¢ã®éã«ãããã©ã«ãã©ã¤ãã©ãªæ¤ç´¢ãã¹ã
        ç¡è¦ããããã«ããªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

    nodelete
        å®è¡æã«ãã¼ãè§£é¤ (unload) ãããªãããã«ã
        ãªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

    nodlopen
        "dlopen" ãé©ç¨ã§ããªããªãããã«ã ãªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

    nodump
        "dldump" ã«ãããã³ãã§ããªããªãããã«ã
        ãªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

    now å®è¡å¯è½ã©ã¤ãã©ãªã¾ãã¯å±æã©ã¤ãã©ãªãçæããã¨ãã«ã
        é¢æ°ãæåã«å¼ã³åºãããã¾ã§é¢æ°å¼ã³åºã解決ãéãããã®ã§ã¯ãªãã
        ããã°ã©ã ã®å®è¡éå§æã¾ãã¯ã å±æã©ã¤ãã©ãªã dlopen
        ã使ããªã³ã¯ããéã«
        ãã¹ã¦ã®ã·ã³ãã«ã解決ããããã«åçãªã³ã«ã«æããããã«ã
        ã©ã¤ãã©ãªã«å°ãä»ãã¾ãã

    origin
        $ORIGIN ãå«ããããããªããªãã¸ã§ã¯ãã«å°ãä»ãã¾ãã

        ä»ã®ãã¼ã¯ã¼ãã¯ãSolaris ã¨ã®äºææ§ã®ããã«ç¡è¦ããã¾ãã

−( archives −)

−−start−group archives −−end−group
    archives ã¯ãã¢ã¼ã«ã¤ããã¡ã¤ã«ã®ãªã¹ããæå®ãã¾ãã
    ãããã¯ãã¡ã¤ã«åãã®ãã®ã§ãã−l ãªãã·ã§ã³ã§ãæ§ãã¾ããã

    æå®ãããã¢ã¼ã«ã¤ãã¯ãæ°ããªæªå®ç¾©åç§ããªããªãã¾ã§ç¹°è¿ãæ¤ç´¢ããã¾ãã
    é常ãã¢ã¼ã«ã¤ãã¯ãã³ãã³ãã©ã¤ã³ã§æå®ãããé çªã§ 1
    åã ãæ¤ç´¢ããã¾ãã ãã®ã¢ã¼ã«ã¤ãä¸‐
    ã®ã·ã³ãã«ããã³ãã³ãã©ã¤ã³ä¸ã®å¾ãã«ç¾ãã ã¢ã¼ã«ã¤ãä¸‐
    ã®ãªãã¸ã§ã¯ããåç§ããæªå®ç¾©ã·ã³ãã«ã









                            ‐13‐


    解決ããã®ã«å¿è¦ãªå ´åããªã³ã«ã¯ãã®åç§ã解決ãããã¨ãã§ãã¾ããã
    ã¢ã¼ã«ã¤ããã°ã«ã¼ãåããã¨ããã¹ã¦ã®å¯è½ãªåç§ã解決ãããã¾ã§ã
    ãããã®ãã¹ã¦ã®ã¢ã¼ã«ã¤ãã¯ç¹°è¿ãæ¤ç´¢ããã¾ãã

    ãã®ãªãã·ã§ã³ã使ç¨ããã¨ãããã©ã¼ãã³ã¹ã大ããè½ã¡ã¾ãã
    ããã使ãã®ã¯ã2 ã¤ä»¥ä¸ã®ã¢ã¼ã«ã¤ãä¸ã§ãåç§ã®å¾ªç°ãé¿ããããªã
    å ´åã®ã¿ã«ä½¿ç¨ããã®ãããã§ãããã

−−accept−unknown−input−arch

−−no−accept−unknown−input−arch
    ãªã³ã«ã«å¯¾ããã¢ã¼ããã¯ãã£ãèå¥ã§ããªãå¥åãã¡ã¤ã«ã
    åãä»ããããã«æ示ãã¾ãã
    ããã¯ãã¦ã¼ã¶ãèªåãä½ããã¦ããããç解ãã¦ãã¦ãããã§ã
    æªç¥ã®å¥åãã¡ã¤ã«ããªã³ã¯ãããã¨ãã¦ããå ´åãæ³å®ãã¦ãã¾ãã
    ãªãªã¼ã¹ 2.14 ããåã«ã¯ããã¡ãã®æ¹ããªã³ã«ã®ããã©ã«ãã®åä½ã§ããã
    ãªãªã¼ã¹ 2.14 以å¾ããããã®å¥åãã¡ã¤ã«ãæå¦ãããããã«ãªãã
    ãã¤ã¦ã®åä½ã«æ»ãããã«ã−−accept−unknown−input−arch
    ãªãã·ã§ã³ã追å ããã¾ããã

−−as−needed

−−no−as−needed
    ãã®ãªãã·ã§ã³ã¯ãã³ãã³ãè¡ã§æå®ããåçã©ã¤ãã©ãªã§ −−as−needed
    ãªãã·ã§ã³ããå¾ã®ãã®ã® ELF DT_NEEDED ã¿ã°ã«å½±é¿ãä¸ãã¾ãã
    é常ããªã³ã«ã¯ ã³ãã³ãã©ã¤ã³ã§æå®ããåçã©ã¤ãã©ãªããããã«å¯¾ã
    ããããå®éã«å¿è¦ãã©ããã«ç¡é¢ä¿ã« DT_NEEDED ã¿ã°ã 追å ãã¾ãã
    −−as−needed ã«ãããé常ãªãã¸ã§ã¯ãããä½ããã®åç§ã
    æºããã©ã¤ãã©ãªã«ã®ã¿ DT_NEEDED ã¿ã°ãä»ããããã«ãªãã¾ãã
    −−no−as−needed ã«ããããã©ã«ãã®åä½ã«æ»ãã¾ãã

−assert keyword
    ãã®ãªãã·ã§ã³ã¯ãSunOS ã¨ã®äºææ§ã®ããã«ç¡è¦ããã¾ãã

−Bdynamic

−dy

−call_shared
    åçã©ã¤ãã©ãªã¨ãªã³ã¯ãã¾ãã
    ããã¯ãå±æã©ã¤ãã©ãªããµãã¼ããããã©ãããã©ã¼ã ä¸ã§ã®ã¿
    æå³ãæã¡ã¾ãã ãã®ãªãã·ã§ã³ã¯ããã®ãããªãã©ãããã©ã¼ã ä¸ã§ã¯ã
    æ®éããã©ã«ãã¨ãªã£ã¦ãã¾ãã
    ãã®ãªãã·ã§ã³ã«ç°ãªãå½¢å¼ãããã®ã¯ãæ§ããªã·ã¹ãã ã¨ã®äºææ§ã®ããã§ãã
    ãã®ãªãã·ã§ã³ã¯ãã³ãã³ãä¸ã§ä½åº¦ã§ã使ç¨ãããã¨ãã§ãã¾ãã
    ããã¯å¾ã«ç¶ã −l ãªãã·ã§ã³ã®ã©ã¤ãã©ãªæ¤ç´¢ã«å½±é¿ãã¾ãã

−Bgroup
    åçã»ã¯ã·ã§ã³ä¸ã® "DT_FLAGS_1" ã¨ã³ããªã® "DF_1_GROUP"
    ãã©ã°ãè¨å®ãã¾ãã
    ããã«ãã£ã¦ãåçãªã³ã«ããã®ãªãã¸ã§ã¯ãã¨ãã®ä¾åé¢ä¿ã®æ¤ç´¢ã
    ã°ã«ã¼ãåã§ã®ã¿å®è¡ããããã«ãªãã¾ãã −−no−unresolved‐
    symbols=report‐all ãæé»ã«æå®ããã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãå±æã©ã¤ãã©ãªããµãã¼ããã ELF









                            ‐14‐


    ãã©ãããã¼ã ä¸ã§ã®ã¿æå³ãæã¡ã¾ãã

−Bstatic

−dn

−non_shared

−static
    å±æã©ã¤ãã©ãªããªã³ã¯ãã¾ããã
    ããã¯ãå±æã©ã¤ãã©ãªããµãã¼ããããã©ãããã©ã¼ã ä¸ã§ã®ã¿
    æå³ãæã¡ã¾ãã
    ãã®ãªãã·ã§ã³ã«ç°ãªãå½¢å¼ãããã®ã¯ãæ§ããªã·ã¹ãã ã¨ã®äºææ§ã®ããã§ãã
    ãã®ãªãã·ã§ã³ã¯ãã³ãã³ãã©ã¤ã³ä¸ã§ä½åº¦ã§ã使ç¨ãããã¨ãã§ãã¾ãã
    ããã¯å¾ã«ç¶ã −l ãªãã·ã§ã³ã®ã©ã¤ãã©ãªæ¤ç´¢ã«å½±é¿ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ −−unresolved−symbols=report−all ã
    æé»ã®ãã¡ã«å«ã¿ã¾ãã

−Bsymbolic
    å±æã©ã¤ãã©ãªãçæããéã«ããã®å±æã©ã¤ãã©ãªä¸ã«å®ç¾©ãããã°ã ã°ã‐
    ã¼ãã«ã·ã³ãã«ã¸ã®åç§ããã®å®ç¾©ã«çµã³ã¤ãã¾ãã
    é常ãå±æã©ã¤ãã©ãªããªã³ã¯ããããã°ã©ã ã¯ã ãã®å±æã©ã¤ãã©ãªä¸‐
    ã®å®ç¾©ãä¸æ¸ãã§ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãå±æã©ã¤ãã©ãªããµãã¼ããã ELF
    ãã©ãããã¼ã ä¸ã§ã®ã¿æå³ãæã¡ã¾ãã

−−check−sections

−−no−check−sections
    ã»ã¯ã·ã§ã³ã¢ãã¬ã¹ãå²ãå½ã¦ãããå¾ããããã®ã¢ãã¬ã¹ãéãªã£ã¦
    ããªããã©ããã®ãã§ãã¯ãããªããããªã³ã«ã«æ示ãã¾ãã
    é常ããªã³ã«ã¯ãã§ãã¯ãè¡ããéãªããçºè¦ããæã¯
    é©åãªã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåãã¾ãã
    ãªã³ã«ã¯ããªã¼ãã¬ã¤ã»ã¯ã·ã§ã³ã®ãã¨ãç¥ã£ã¦ããã
    ãããçæãããã¨ã許å¯ãã¾ãã ã³ãã³ãã©ã¤ã³ã¹ã¤ãã
    −−check−sections ã使ç¨ãããã¨ã§ã ããã©ã«ãã®åä½ã«æ»ãã¾ãã

−−cref
    ç¸äºåç§ãã¼ãã«ãåºåãã¾ãã ãªã³ã«ããããã¡ã¤ã«ãçæãããå ´åã
    ç¸äºåç§ãã¼ãã«ã¯ããããã¡ã¤ã«ã«åºåããã¾ãã
    ãã以å¤ã®å ´åãæ¨æºåºåã«åºåããã¾ãã

    ãã¼ãã«å½¢å¼ã¯ãæå³çã«ç°¡åã«ãã¦ããã®ã§ã
    å¿è¦ãªå ´åã¯ã¹ã¯ãªããã§ç°¡åã«å¦çãããã¨ãã§ãã¾ãã
    ã·ã³ãã«ã¯ãååã§ã½ã¼ãããã¦åºåããã¾ãã
    ããããã®ã·ã³ãã«ãã¨ã«ããã¡ã¤ã«åããªã¹ãããã¾ãã
    ã·ã³ãã«ãå®ç¾©ããã¦ããå ´åã¯ããªã¹ãã®æåã®ãã¡ã¤ã«ã«
    ãã®å®ç¾©ãå«ã¾ãã¦ãã¾ãã
    æ®ãã®ãã¡ã¤ã«ã¯ããã®ã·ã³ãã«ã¸ã®åç§ãå«ãã§ãã¾ãã

−−no−define−common
    ãã®ãªãã·ã§ã³ã¯ãã³ã¢ã³ã·ã³ãã«ã¸ã®ã¢ãã¬ã¹å²ãå½ã¦ãæå¶ãã¾ãã
    ã¹ã¯ãªããã³ãã³ã "INHIBIT_COMMON_ALLOCATION" ã¯ã
    åãå¹æãæã¡ã¾ãã









                            ‐15‐


    −−no−define−common ãªãã·ã§ã³ã¯ãã³ã¢ã³ã·ã³ãã«ã¸ã¢ãã¬ã¹ã
    å²ãå½ã¦ãå¤æããåºåãã¡ã¤ã«ã®ã¿ã¤ãã®é¸æããåãé¢ãã¾ãã
    ãã®ãªãã·ã§ã³ãæå®ããªãå ´åã¯ãåéç½®ä¸å¯ã®åºåã¿ã¤ãã«ãã£ã¦ã
    ã¢ãã¬ã¹ã¯å¼·å¶çã«ã³ã¢ã³ã·ã³ãã«ã¸å²ãå½ã¦ããã¾ãã
    −−no−define−common ã使ç¨ãããã¨ã«ãããå±æã©ã¤ãã©ãªãã
    åç§ãããã³ã¢ã³ã·ã³ãã«ã¯ã主ãã‐
    ã°ã©ã ã®ã¢ãã¬ã¹ã®ã¿ã«å²ãå½ã¦ããã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãå±æã©ã¤ãã©ãªä¸ã®éè¤ããæªä½¿ç¨é åãåé¤ãã¾ãã
    ã¾ããåçã·ã³ãã«è§£æ±ºããããã«ç¹æ®ãªæ¤ç´¢ãã¹ãæã¤ããããã®
    åçã¢ã¸ã¥ã¼ã«ãããå ´åãééã£ãéè¤ã解決ããéã«èµ·ããå¾ãæ··ä¹±ã
    é²ãã¾ãã

−−defsym symbol=expression
    expression ã§æå®ããã絶対ã¢ãã¬ã¹ãå«ãã  ã°ã‐
    ã¼ãã«ã·ã³ãã«ããåºåãã¡ã¤ã«ã«çæãã¾ãã
    è¤æ°ã®ã·ã³ãã«ãå®ç¾©ããããã«ãã³ãã³ãã©ã¤ã³ä¸ã§å¿è¦ãªåæ°ã ã
    ãã®ãªãã·ã§ã³ã使ç¨ã§ãã¾ãã expression
    ã«ã¯ãéå®ãããå½¢å¼ã®ç®è¡æ¼ç®ããµãã¼ãããã¦ã¾ãã 16 é²å®æ°ãå‐
    å¨ããã·ã³ãã«åã使ç¨ã§ãã 16 é²å®æ°ãã·ã³ãã«ã®å æ¸ç®ã« "+" ã
    "−" ã 使ç¨ã§ãã¾ãã
    ãã£ã¨è¤éãªå¼ãå¿è¦ã§ããã°ãã¹ã¯ãªãããããªã³ã«ã®ã³ãã³ãè¨èªã
    使ç¨ãããã¨ãæ¤è¨ãã¦ãã ããã 注æ: symbol ãçå·
    (‘‘=’’)ãexpression ã®é㫠空ç½ãå¥ãã¦ã¯ããã¾ããã

−−demangle[=style]

−−no−demangle
    ãããã®ãªãã·ã§ã³ã¯ãã¨ã©ã¼ã¡ãã»ã¼ã¸ããã®ä»ã®åºåã«å«ã¾ãã
    ã·ã³ãã«åãããã³ã°ã«ãããã©ãããå¶å¾¡ãã¾ãã
    ããã³ã°ã«ããå ´åããªã³ã«ã¯ã·ã³ãã«åãèªã¿ãããå½¢å¼ã§
    表ç¾ãããã¨è©¦ã¿ã¾ãã
    ã¤ã¾ããªã³ã«ã¯ãåé ã®ã¢ã³ãã¹ã³ã¢ããªãã¸ã§ã¯ããã¡ã¤ã«å½¢å¼ã§
    使ç¨ããã¦ããå ´åããããåãé¤ããC++ ã®ãã³ã°ã«ãããã·ã³ãã«åã
    ã¦ã¼ã¶ãèªã¿ãããååã«å¤æãã¾ãã
    ã³ã³ãã¤ã©ã«ãã£ã¦ãã³ã°ã«å½¢å¼ã¯ç°ãªãã¾ãã
    ããã³ã°ã«å½¢å¼å¼æ°ãæå®ãããã¨ã«ããã使ç¨ãã¦ããã³ã³ãã¤ã©ã«å¯¾å¿ãã
    ããã³ã°ã«å½¢å¼ãé¸æã§ãã¾ãã ãªã³ã«ã¯ãç°å¢å¤æ°
    COLLECT_NO_DEMANGLE ãè¨å®ããã¦ããªãéãã
    ããã©ã«ãã§ããã³ã°ã«ãã¾ãã
    ãããã®ãªãã·ã§ã³ã«ãã£ã¦ãããã©ã«ããä¸æ¸ãã§ãã¾ãã

−−dynamic−linker file
    åçãªã³ã«ã®ååãè¨å®ãã¾ãã ããã¯ãåçã«ãªã³ã¯ããã ELF
    å®è¡å½¢å¼ãçæããæã®ã¿ æå³ãããã¾ãã
    é常ã¯ãããã©ã«ãã®åçãªã³ã«ã§æ£ããã¯ãã§ãã
    èªåãä½ããããã¨ãã¦ããã®ããããã£ã¦ãå ´å以å¤ã¯ã
    使ç¨ããªãã§ãã ããã

−−embedded−relocs
    ãã®ãªãã·ã§ã³ã¯ãGNU ã³ã³ãã¤ã©ã¨ã¢ã»ã³ãã©ã« −membedded−pic
    ãªãã·ã§ã³ãæå®ãã¦çæãã MIPS ã®åã込㿠PIC ã³ã¼ãã
    ãªã³ã¯ããæã®ã¿æå³ãããã¾ãã
    ãããæå®ããã¨ããªã³ã«ã¯ãããã¼ãã«ãçæãã¾ãã
    ãã®ãã¼ãã«ã¯ããã¤ã³ã¿ã®å¤ã«éçã«åæåããã¦ãããã¹ã¦ã®ãã¼ã¿ãã









                            ‐16‐


    å®è¡æã«åéç½®ããããã«ä½¿ããã¾ãã 詳細ã¯ãtestsuite/ld−empic
    ã®ã³ã¼ããåç§ãã¦ãã ããã

−−fatal−warnings
    ãã¹ã¦ã®è¦åããã¨ã©ã¼ã¨ãã¦æ±ãã¾ãã

−−force−exe−suffix
    åºåãã¡ã¤ã«ã®ãµãã£ãã¯ã¹ã .exe ã¨ãªãããã«ãã¾ãã

    ãã®ãªãã·ã§ã³ãæå®ããã¨ãç¡äºã«çæããå®å¨ã«ãªã³ã¯ããã
    åºåãã¡ã¤ã«ã« ".exe" ã ".dll" ã¨ãã
    ãµãã£ãã¯ã¹ãã¤ãã¦ããªãã£ãå ´åããªã³ã«ã¯åºåãã¡ã¤ã«ããåãååã«
    ".exe" ãµãã£ãã¯ã¹ãã¤ãããã¡ã¤ã«ã«ã³ãã¼ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãMicrosoft Windows ãã¹ãä¸ã§ã æªä¿®æ£ã®
    Unix ç¨ã® makefile ã使ç¨ããå ´åã«ä¾¿å©ã§ãã
    ã¨ããã®ããWindows ã®ããã¤ãã®ãã¼ã¸ã§ã³ã§ã¯ã ".exe"
    ãµãã£ãã¯ã¹ãã¤ãã¦ããªãã¤ã¡ã¼ã¸ã å®è¡ã§ããªãããã§ãã

−−no−gc−sections

−−gc−sections
    æªä½¿ç¨ã®å¥åã»ã¯ã·ã§ã³ã®ã¬ã¼ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ãæå¹ã«ãã¾ãã
    ãã®ãªãã·ã§ã³ããµãã¼ããã¦ããªãã¿ã¼ã²ããä¸ã§ã¯ç¡è¦ããã¾ãã
    ãã®ãªãã·ã§ã³ã¯ã−r ã¨ã¯äºææ§ãããã¾ãããã
    åçãªã³ã¯ã¨ä¸ç·ã«ä½¿ãã¹ãã§ãããã¾ããã ããã©ã«ãã®åä½
    (ã¬ã¼ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ãå®è¡ããªã) ã«æ»ãã«ã¯ã
    ã³ãã³ãã©ã¤ã³ã§ −−no−gc−sections ãæå®ãã¦ãã ããã

−−help
    ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã®æ¦è¦ãæ¨æºåºåã«è¡¨ç¤ºããçµäºãã¾ãã

−−target−help
    ã¿ã¼ã²ããåºæã®ãªãã·ã§ã³ã®è¦ç´ãæ¨æºåºåã«è¡¨ç¤ºããçµäºãã¾ãã

−Map mapfile
    ãªã³ã¯ãããããã¡ã¤ã« mapfile ã¸åºåãã¾ãã ååºã® −M
    ãªãã·ã§ã³ã®è¨è¿°ãåç§ãã¦ãã ããã

−−no−keep−memory
    é常 ld ã¯ãå¥åãã¡ã¤ã«ã®ã·ã³ãã«ãã¼ãã«ãã¡ã¢ãªã« ã‐
    ã£ãã·ã¥ãããã¨ã§ãã¡ã¢ãªä½¿ç¨éãããé度ãåªåãã¾ãã
    ãã®ãªãã·ã§ã³ãæå®ããã¨ãld ã¯ãå¿è¦ã«å¿ã㦠ã·ã³ãã«ãã¼ãã«ãèª‐
    ããã¨ã§ãã¡ã¢ãªä½¿ç¨éãæå°ã«ãã¾ãã
    ããã¯ã大ããªå®è¡å½¢å¼ããªã³ã¯ããéã«ãld ã
    ã¡ã¢ãªç©ºéã使ãæããã¦ãã¾ããããªå ´åã«å¿è¦ã¨ãªãã¾ãã

−−no−undefined

−z defs
    é常ãªãã¸ã§ã¯ããã¡ã¤ã«ããã®æªè§£æ±ºã·ã³ãã«ã®åç§ãå ±åãã¾ãã
    éã·ã³ãã«å±æã©ã¤ãã©ãªãçæãã¦ããå ´åã«ããã®å ±åããªããã¾ãã
    ãªã³ã¯ããã¦ããå±æã©ã¤ãã©ãªã«ãããæªè§£æ±ºåç§ã®å ±ååä½ã®
    å¶å¾¡ã¯ãã¹ã¤ãã −−[no−]allow−shlib−undefined ã§ãã










                            ‐17‐


−−allow−multiple−definition

−z muldefs
    é常ãã·ã³ãã«ãè¤æ°åå®ç¾©ãããã¨ããªã³ã«ã¯è´å½çãªã¨ã©ã¼ãå ±åãã¾ãã
    ãããã®ãªãã·ã§ã³ã¯è¤æ°åã®å®ç¾©ã許ããæåã®å®ç¾©ã使ç¨ããããã«ãªãã¾ãã

−−allow−shlib−undefined

−−no−allow−shlib−undefined
    å±æã©ã¤ãã©ãªä¸ã®æªå®ç¾©ã·ã³ãã«ãè¨±å¯ (ããã©ã«ã) ãããã¯
    ä¸è¨±å¯ã«ãã¾ãã
    ãã®ã¹ã¤ããã¯ãæªå®ç¾©ã·ã³ãã«ãé常ãªãã¸ã§ã¯ããã¡ã¤ã«ã§ã¯ãªã
    å±æã©ã¤ãã©ãªã«åå¨ããå ´åã®æåã決å®ããã¨ãããé¤ãã°
    −−no−undefined ã¨åæ§ã§ãã
    ãã®ã¹ã¤ããã¯ãé常ãªãã¸ã§ã¯ããã¡ã¤ã«ã«ç½®ããæªå®ç¾©ã·ã³ãã«ã®
    æ±ãã«ã¯å½±é¿ãã¾ããã

    ããã©ã«ãã −−allow−shlib−undefined ã¨ãªã£ã¦ããçç±ã¯ã
    ã·ã³ãã«ãå®éã«ã¯ãã¼ãæã«è§£æ±ºå¯è½ã¨ãªãå ´åãããã
    ãªã³ã¯æã«æå®ããã¦ããå±æã©ã¤ãã©ãªãå®è¡æã®å±æã©ã¤ãã©ãªã¨
    åããã®ã¨ã¯éããªãã¨ãããã¨ã«ããã¾ãã ããã«å ãã¦ã(BeOS ã®ããã«)
    å±æã©ã¤ãã©ãªä¸ã®æªå®ç¾©ã·ã³ãã«ã æ£å¸¸ã§ããã·ã¹ãã ã®å‐
    å¨ãããã¾ã (ã«ã¼ãã«ã¯æªå®ç¾©ã·ã³ãã«ãå«ã å±æã©ã¤ãã©ãªã«ã‐
    ã¼ãæã«ããããå½ã¦ãç¾å¨ã®ã¢ã¼ããã¯ãã£ã§ æé©ãªé¢æ°ãé¸æãã¾ãã
    ããã¯ä¾ãã°é©å㪠memset é¢æ°ã åçã«é¸æããã¨ãã£ããã¨ã§ã)ã HPPA
    ã®å±æã©ã¤ãã©ãªãã¾ããæªå®ç¾©ã·ã³ãã«ãæã¤ãã¨ã¯ æ‐
    £å¸¸ãªã®ã¯æããã§ãã

−−no−undefined−version
    é常ã¯ãã·ã³ãã«ãæªå®ç¾©ãã¼ã¸ã§ã³ãæã¤å ´åããªã³ã«ã¯ãããç¡è¦ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãæªå®ç¾©ãã¼ã¸ã§ã³ã®ã·ã³ãã«ã許ããã
    代ãã«è´å½çãªã¨ã©ã¼ãå ±åãã¾ãã

−−no−warn−mismatch
    é常 ld ã¯ãä¸é©å½ãªå¥åãã¡ã¤ã«ããªã³ã¯ãããã¨ããå ´åã
    ã¨ã©ã¼ãçºãã¾ãã ä¾ãã°ãç°ãªããã‐
    ã»ããµåãããããã¯ç°ãªãã¨ã³ãã£ã¢ã³åãã«
    ã³ã³ãã¤ã«ããããã®ã§ããã¨ããå ´åã§ãã ãã®ãªãã·ã§ã³ãæå®ããã¨ãld
    ã¯ããã®ãããªèµ·ãå¾ãã¨ã©ã¼ã ã ã¾ã£ã¦è¨±å¯ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ããªã³ã«ã®ã¨ã©ã¼ãé©åã§ãªãã¨åãã£ã¦ãã
    ç¹æ®ãªãã¨ããæã®ã¿ä½¿ç¨ãã使ç¨ã®éã«ã¯æ³¨æããªãã¦ã¯ãªãã¾ããã

−−no−whole−archive
    以å¾ã«ç¶ãã¢ã¼ã«ã¤ããã¡ã¤ã«ã«å¯¾ãã¦ã −−whole−archive
    ãªãã·ã§ã³ã®å¹æãç¡å¹ã«ãã¾ãã

−−noinhibit−exec
    å©ç¨å¯è½ãªããã¤ããå®è¡å½¢å¼ã®åºåãã¡ã¤ã«ãæ®ãã¦ããã¾ãã
    æ®éãªã³ã«ã¯ããªã³ã¯å¦çä¸ã«ã¨ã©ã¼ãçºçããå ´åã
    åºåãã¡ã¤ã«ãçæãã¾ããã
    ã©ããªã¨ã©ã¼ãçºçãã¦ããåºåãã¡ã¤ã«ãæ¸ããã«çµäºãã¾ãã

−nostdlib
    ã³ãã³ãã©ã¤ã³ä¸ã§æ示çã«æå®ãããã©ã¤ãã©ãªãã£ã¬ã¯ããªã®ã¿ãæ¤ç´¢ãã¾ãã









                            ‐18‐


    ãªã³ã«ã¹ã¯ãªããä¸ã§æå®ãããã©ã¤ãã©ãªãã£ã¬ã¯ããªã¯ã
    (ã³ãã³ãã©ã¤ã³ä¸ã§æå®ããããªã³ã«ã¹ã¯ãªããã§ãã£ã¦ã)
    ç¡è¦ããã¾ãã

−−oformat output‐format
    ld ã¯ã2 種é¡ä»¥ä¸ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ããµãã¼ãããããã«
    æ§æãããã¨ãã§ãã¾ãã ld ããã®ããã«æ§æããã¦ããå ´åã−−oformat
    ãªãã·ã§ã³ã
    ç¨ãã¦ãåºåãã¡ã¤ã«ã®ãã¤ããªå½¢å¼ãæå®ãããã¨ãã§ãã¾ãã ããã ld
    ãå¥ã®ãªãã¸ã§ã¯ãå½¢å¼ããµãã¼ããããã
    æ§æããã¦ããã¨ãã¦ããé常ã¯ãã®ãªãã·ã§ã³ãæå®ããå¿è¦ã¯ããã¾ããã
    ã¨ããã®ããld ã¯ãããããã®ãã·ã³ä¸ã§æããããµããå½¢å¼ã
    ããã©ã«ãã®åºåå½¢å¼ã¨ããããæ§æããã¦ããã¯ãã ããã§ãã output‐
    format ã¯ããã¹ãæååã§ãBFD ã©ã¤ãã©ãªã«ãã£ã¦
    ãµãã¼ãããã¦ããç¹å®ã®å½¢å¼ã®ååã§ã (objdump −i
    ãç¨ãã¦ãå©ç¨å¯è½ãªãã¤ããªå½¢å¼ããªã¹ãã§ãã¾ã)ã
    ã¹ã¯ãªããã³ãã³ã "OUTPUT_FORMAT" ã§ããåºåå½¢å¼ã
    æå®ãããã¨ãã§ãã¾ããããã®ãªãã·ã§ã³ã«ãã£ã¦ä¸æ¸ãããã¾ãã

−pie

−−pic−executable
    ä½ç½®ç¬ç«å®è¡å½¢å¼ãçæãã¾ãã ç¾å¨ã®ã¨ããããã㯠ELF
    ãã©ãããã©ã¼ã ã§ã®ã¿ãµãã¼ãããã¦ãã¾ãã
    ä½ç½®ç¬ç«å®è¡å½¢å¼ã¯ãå±æã©ã¤ãã©ãªã¨åæ§ã«ã OS
    ãé¸æããä»®æ³ã¢ãã¬ã¹ (å¼ã³åºããã¨ã«ç°ãªã) ã«
    åçãªã³ã«ã«ããåéç½®ããã¾ãã
    åçãªã³ã¯ãããé常ã®å®è¡å½¢å¼ã®ããã«ãä½ç½®ç¬ç«å®è¡å½¢å¼ã¯å®è¡å¯è½ã§ããã
    å®è¡å½¢å¼ä¸‐
    ã§å®ç¾©ãããã·ã³ãã«ã¯å±æã©ã¤ãã©ãªã«ããä¸æ¸ãã§ãã¾ããã

−qmagic
    ãã®ãªãã·ã§ã³ã¯ãLinux äºææ§ã®ããã«ç¡è¦ããã¾ãã

−Qy ãã®ãªãã·ã§ã³ã¯ãSVR4 äºææ§ã®ããã«ç¡è¦ããã¾ãã

−−relax
    ãã·ã³ä¾åã®å¹æãæã¤ãªãã·ã§ã³ã§ãã
    ãã®ãªãã·ã§ã³ããµãã¼ããã¦ããã¿ã¼ã²ããã¯ãå°æ°ã§ãã

    ããã¤ãã®ãã©ãããã¼ã ã§ã¯ã−−relax ãªãã·ã§ã³ã¯ã ãªã³ã«ããã‐
    ã°ã©ã ä¸ã®ã¢ãã¬ãã·ã³ã°ã解決ã§ããå ´åã«å¯è½ã¨ãªã
    大åçãªæé©åãå®è¡ãã¾ãã ããã¯ãåºåãªãã¸ã§ã¯ããã¡ã¤ã«ä¸‐
    ã®ã¢ãã¬ã¹ã¢ã¼ãã®ç·©åãã æ°è¦å½ä»¤ã®åæãªã©ã§ãã

    ããã¤ãã®ãã©ãããã¼ã ä¸ã§ã¯ããã®ãããªãªã³ã¯æã®å¤§åçãªæé©åã«ãã£ã¦ã
    çæãããå®è¡å½¢å¼ã®ã·ã³ããªãã¯ãããã°ãä¸å¯è½ã¨ãªãå ´åãããã¾ãã
    ä¸å¯è½ã«ãªããã¨ãç¥ããã¦ããã®ã¯ãæ¾ä¸ã® MN10200 ã MN10300 ãã‐
    ã»ããµãã¡ããªã§ãã

    ããããµãã¼ãããã¦ããªããã©ãããã¼ã ã§ã¯ã −−relax
    ã¯åãä»ãããã¾ãããç¡è¦ããã¾ãã











                            ‐19‐


−−retain−symbols−file filename
    ãã¡ã¤ã« filename ä¸ã«ãªã¹ããããã·ã³ãã«ã®ã¿ãæ®ãã
    ä»ã®ã·ã³ãã«ããã¹ã¦ç ´æ£ãã¾ãã filename ã¯ã1 è¡ãã¨ã« 1
    ã¤ã®ã·ã³ãã«åãæ¸ãã¦ãã åãªãå¹³å¦ãªãã¡ã¤ã«ã§ãã
    ãã®ãªãã·ã§ã³ã¯ç¹ã«ãå®è¡æã®ã¡ã¢ãªãç¯ç´ããããã«ã 1
    ã¤ã®å¤§ãã大åçãªã·ã³ãã«ãã¼ãã«ãå¾ãã«å¢ãã¦ãã (VxWorks
    ã®ãããª) ç°å¢ã§å½¹ã«ãã¡ã¾ãã

    −−retain−symbols−file ã¯ãæªå®ç¾©ã·ã³ãã«ã
    åéç½®ã«å¿è¦ãªã·ã³ãã«ã¯å»æ£ãã¾ããã

    −−retain−symbols−file ã¯ã ã³ãã³ãã©ã¤ã³ä¸ã§ 1
    åããæå®ãããã¨ãã§ãã¾ããã ããã¯ã−s ã −S ãç¡å¹ã«ãã¾ãã

−rpath dir
    å®è¡æã©ã¤ãã©ãªæ¤ç´¢ãã¹ã¸ãã£ã¬ã¯ããªã追å ãã¾ãã ããã¯ãELF
    å®è¡å½¢å¼ãå±æãªãã¸ã§ã¯ãã¨ãªã³ã¯ããæ㫠使ç¨ããã¾ãã ãã¹ã¦ã®
    −rpath ã®å¼æ°ã¯çµåãããåçãªã³ã«ã«æ¸¡ããã¾ãã
    åçãªã³ã«ã¯ãããããç¨ãã¦å®è¡æã«å±æãªãã¸ã§ã¯ããæ¤ç´¢ãã¾ãã
    −rpath ãªãã·ã§ã³ã¯ãæ示çã«ãªã³ã¯ãããå±æãªãã¸ã§ã¯ãã«ãã£ã¦
    å¿è¦ã¨ãããå±æãªãã¸ã§ã¯ããæ¤ç´¢ããã®ã«ã使ç¨ããã¾ãã
    ããã«ã¤ãã¦ã¯ã−rpath−link ãªãã·ã§ã³ã®è¨è¿°ãåç§ãã¦ãã ããã
    ELF å®è¡å½¢å¼ããªã³ã¯ããæã« −rpath ã使ç¨ããã¦ãªãå ´åã
    ç°å¢å¤æ° "LD_RUN_PATH" ã®å容ãå®ç¾©ããã¦ããã°ã
    ããã使ããã¾ãã

    −rpath ãªãã·ã§ã³ã¯ãSunOS ä¸ã§ã使ç¨ããã¾ãã SunOS
    ä¸ã§ã¯ããã©ã«ãã§ããªã³ã«ã¯æå®ããããã¹ã¦ã® −L
    ãªãã·ã§ã³ããå®è¡ææ¤ç´¢ãã¹ãä½æãã¾ãã −rpath
    ãªãã·ã§ã³ãæå®ãããå ´åãå®è¡ææ¤ç´¢ãã¹ã¯ −L
    ãªãã·ã§ã³ãç¡è¦ãã−rpath ãªãã·ã§ã³ã®ã¿ãç¨ãã¦ä½æããã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãgcc ã使ç¨ããæã«å½¹ã«ç«ã¡ã¾ãã ã¨ããã®ã¯ãgcc
    ã¯æ²¢å±±ã® −L ãªãã·ã§ã³ã追å ãããã㯠NFS
    ãã¦ã³ãããããã¡ã¤ã«ã·ã¹ãã ä¸ã«ãããããããªãããã§ãã

    ä»ã® ELF ãªã³ã«ã¨ã®äºææ§ã®ããã«ã−R ãªãã·ã§ã³ã®å¾ã«
    ãã¡ã¤ã«åã§ã¯ãªããã£ã¬ã¯ããªåãç¶ããå ´åã −rpath
    ãªãã·ã§ã³ã¨ãã¦æ±ããã¾ãã

−rpath−link DIR
    ELF ããã㯠SunOS ã使ç¨ããå ´åãããå±æã©ã¤ãã©ãªã ãã 1
    ã¤å¥ã®å±æã©ã¤ãã©ãªãè¦æ±ãããã¨ãããã¾ãã ããã¯ã"ld −shared"
    ã¨ãã¦ãªã³ã¯ããæã å¥åãã¡ã¤ã«ã® 1
    ã¤ã«å±æã©ã¤ãã©ãªãå«ã¾ãã¦ããå ´åã«èµ·ããã¾ãã

    éå±æãåéç½®ä¸å¯ã®ãªã³ã¯ãè¡ãæã«ãªã³ã«ããã®ãããªä¾å‐
    æ§ã«åºåãã¨ã
    ãããæ示çã«ãªã³ã¯ããã¦ãªãå ´åããªã³ã«ã¯è¦æ±ãããå±æã©ã¤ãã©ãªã
    èªåçã«æ¢ãããªã³ã¯ã«å«ãããã¨ãã¾ãã ãã®ãããªå ´åã−rpath−link
    ãªãã·ã§ã³ã¯ãæ¤ç´¢ããæåã® ãã£ã¬ã¯ããªã®çµãæå®ãã¾ãã
    −rpath−link ãªãã·ã§ã³ã§ä¸é£ã®ãã£ã¬ã¯ããªåãæå®ããã«ã¯ã ã³ã‐
    ã³åºåãã®ååã®ãªã¹ãã§æå®ãã¦ãããã§ããã
    è¤æ°åãªãã·ã§ã³ãæå®ãã¦ãæ§ãã¾ããã










                            ‐20‐


    ãã®ãªãã·ã§ã³ã¯æ³¨ææ·±ã使ç¨ããªããã°ãªãã¾ããã
    ã¨ããã®ããããã¯ã³ã³ãã¤ã«æã«å±æã©ã¤ãã©ãªã«åãè¾¼ã¾ãã
    æ¤ç´¢ãã¹ãä¸æ¸ããã¦ãã¾ãããã§ãã
    ãã®ãããªå ´åãåçãªã³ã«ã使ç¨ããã®ã¨ã¯éã£ãæ¤ç´¢ãã¹ãã
    æå³ããã«ä½¿ç¨ããã¦ãã¾ããã¨ãããã¾ãã

    ãªã³ã«ã¯ãè¦æ±ãããå±æã©ã¤ãã©ãªãæ¢ãéã«ä»¥ä¸ã®æ¤ç´¢ãã¹ã使ç¨ãã¾ãã

    1.  −rpath−link ãªãã·ã§ã³ã«ãã£ã¦æå®ããããã¹ã¦ã®ãã£ã¬ã¯ããªã

    2.  −rpath ãªãã·ã§ã³ã§æå®ããããã¹ã¦ã®ãã£ã¬ã¯ããªã −rpath ã¨
        −rpath−link ã®éãã¯ã−rpath ãªãã·ã§ã³ã§
        æå®ããããã£ã¬ã¯ããªã¯ãå®è¡å½¢å¼ã«å«ãããå®è¡æã«ä½¿ç¨ããã¾ããã
        −rpath−link ãªãã·ã§ã³ã¯ããªã³ã¯æã«ã®ã¿å½±é¿ãã¾ãã
        ããã¯ããã¤ãã£ãã®ãªã³ã«å°ç¨ã§ãã

    3.  ELF ã·ã¹ãã ä¸ã§ −rpath ããã㯠"rpath−link"
        ãªãã·ã§ã³ã使ãããªãã£ãå ´åã ç°å¢å¤æ° "LD_RUN_PATH"
        ã®å容ãæ¤ç´¢ããã¾ãã ããã¯ããã¤ãã£ãã®ãªã³ã«å°ç¨ã§ãã

    4.  SunOS ä¸ã§ −rpath ã使ãããªãã£ãå ´åã −L
        ãªãã·ã§ã³ã§æå®ããããã¹ã¦ã®ãã£ã¬ã¯ããªãæ¤ç´¢ããã¾ãã

    5.  ãã¤ãã£ãã®ãªã³ã«ã®å ´åãç°å¢å¤æ° "LD_LIBRARY_PATH"
        ã®å容ã

    6.  ãã¤ãã£ãã® ELF ãªã³ã«ã®å ´åãå±æã©ã¤ãã©ãªã®
        "DT_RUNPATH" ããã㯠"DT_RPATH" ä¸ã®
        ãã£ã¬ã¯ããªããå¿è¦ã¨ãããå±æã©ã¤ãã©ãªã®æ¤ç´¢ã«ä½¿ç¨ããã¾ãã
        "DT_RUNPATH" ã¨ã³ããªãåå¨ããå ´åã "DT_RPATH"
        ã¨ã³ããªã¯ç¡è¦ããã¾ãã

    7.  ããã©ã«ãã®ãã£ã¬ã¯ããªã é常ã/lib 㨠/usr/lib ã§ãã

    8.  ELF ã·ã¹ãã ä¸ã®ãã¤ãã£ããªãªã³ã«ã®å ´åã ãã¡ã¤ã«
        /etc/ld.so.conf ãåå¨ãã¦ãããã ãã®ãã¡ã¤ã«ä¸‐
        ã®ãã£ã¬ã¯ããªã®ãªã¹ãã

        è¦æ±ãããå±æã©ã¤ãã©ãªãè¦ã¤ãããªãå ´åã ãªã³ã«ã¯è‐
        ¦åãåºããªã³ã¯ãç¶ç¶ãã¾ãã

−shared

−Bshareable
    å±æã©ã¤ãã©ãªãä½æãã¾ãã ç¾å¨ããã¯ãELF, XCOFF, SunOS
    ä¸ã®ã¿ã§ãµãã¼ãããã¦ãã¾ãã SunOS ä¸ã§ã¯ã−e
    ãªãã·ã§ã³ã使ç¨ããã¦ãããããªã³ã¯æã« æªå®ç¾©ã·ã³ãã«ãå‐
    å¨ãã¦ããã°ããªã³ã«ã¯èªåçã«å±æã©ã¤ãã©ãªãä½æãã¾ãã

−−sort−common
    ãã®ãªãã·ã§ã³ãæå®ããã¨ãld ã¯ãã³ã¢ã³ã·ã³ãã«ã
    é©åãªåºåã»ã¯ã·ã§ã³ã«éç½®ããéã«ãµã¤ãºã§ã½ã¼ããã¾ãã
    æåã«ãã¹ã¦ã® 1 ãã¤ãã®ã·ã³ãã«ãéç½®ããã次ã«ãã¹ã¦ã® 2
    ãã¤ãã®ã·ã³ãã«ã ããã¦ãã¹ã¦ã® 4









                            ‐21‐


    ãã¤ãã®ã·ã³ãã«ãããã¦ãã®ä»ã®ã·ã³ãã«ãéç½®ããã¾ãã
    ãã®ããã«ããã®ã¯ãã¢ã©ã¤ã³ã¡ã³ãã®å¶ç´ã«ãã£ã¦ã·ã³ãã«ã®éã«
    ééãçããã®ãé²ãããã§ãã

−−split−by−file [size]
    −−split−by−reloc ã¨åãã§ãããåãã®å¥åãã¡ã¤ã«ã«å¯¾ãã size
    ã«éãããã³ã«æ°ããåºåã»ã¯ã·ã§ã³ãä½æãã¾ãã size
    ãæå®ãããªãã£ãå ´åãããã©ã«ãã®ãµã¤ãºã¯ 1 ã§ãã

−−split−by−reloc [count]
    ãã¡ã¤ã«ä¸ã® 1 ã¤ã®åºåã»ã¯ã·ã§ã³ããcount ããå¤ãåéç½®æå ±ã
    å«ã¾ãªããããåºåãã¡ã¤ã«ä¸ã«ä½åãªã»ã¯ã·ã§ã³ãä½æãããã¨ãã¾ãã
    ããã¯ãCOFF ãªãã¸ã§ã¯ãå½¢å¼ã®ãªã¢ã«ã¿ã¤ã ã«ã¼ãã«ã« ãã¦ã³ã‐
    ã¼ãããããã®å·¨å¤§ãªåéç½®å¯è½ãã¡ã¤ã«ãä½æããæã«å½¹ã«ç«ã¡ã¾ãã
    ã¨ããã®ããCOFF ã§ã¯ 1 ã¤ã®ã»ã¯ã·ã§ã³ã¯ 65535 ãè¶ãã
    åéç½®æå ±ã表ç¾ãããã¨ãã§ããªãããã§ãã
    ãã®ãªãã·ã§ã³ã¯ãä»»æã®ã»ã¯ã·ã§ã³ããµãã¼ããã¦ããªã
    ãªãã¸ã§ã¯ããã¡ã¤ã«å½¢å¼ã§ã¯ããã¾ããããªããã¨ã«æ³¨æãã¦ãã ããã
    ãªã³ã«ã¯ãåéãç´ãéã«åãã®å¥åã»ã¯ã·ã§ã³ãåå²ããªãã®ã§ã 1
    ã¤ã®å¥åã»ã¯ã·ã§ã³ã count ãè¶ããåéç½®æå ±ãå«ãã§ããå ´åã 1
    ã¤ã®åºåã»ã¯ã·ã§ã³ã«ã¯ãããã ãã®æ°ã®åéç½®æå ±ãå«ããã¨ã«ãªãã¾ãã
    count ã®ããã©ã«ãå¤ã¯ 32768 ã§ãã

−−stats
    å®è¡æéãã¡ã¢ãªä½¿ç¨éãªã©ã¨ãã£ããªã³ã«ã®å¦çã«é¢ããçµ±è¨æå ±ãã
    è¨ç®ãåºåãã¾ãã

−−traditional−format
    ã¿ã¼ã²ããã«ãã£ã¦ã¯ãld ã®åºåãæ¢åã®ãªã³ã«ã®åºåã¨
    ããã¤ãã®ç¹ã§ç°ãªããã¨ãããã¾ãã ãã®ã¹ã¤ãããæå®ããã¨ã ld ã¯æ¢å‐
    ã®ãªã³ã«ã®å½¢å¼ã使ãã¾ãã

    ä¾ãã° SunOS ä¸ã§ã¯ãld ã¯ã·ã³ãã«æååãã¼ãã«åã®
    éè¤ããã¨ã³ããªã 1 ã¤ã«ãã¾ãã
    ããã«ãã£ã¦ãå®å¨ãªãããã°æå ±ãæã¤åºåãã¡ã¤ã«ã®ãµã¤ãºãã 30%
    以ä¸ãå°ãããªãã¾ãã æ®å¿µãªãã¨ã«ãSunOS ã® "dbx" ãã‐
    ã°ã©ã ã¯ã çæããããã¡ã¤ã«ãèªã¿è¾¼ããã¨ãã§ãã¾ãã ("gdb"
    ã§ã¯åé¡ããã¾ãã)ã −−traditional−format ã¹ã¤ãããæå®ããã¨ã
    éè¤ããã¨ã³ããªã 1 ã¤ã«ã¾ã¨ãã¾ããã

−−section−start sectionname=org
    åºåãã¡ã¤ã«ä¸ã®ã»ã¯ã·ã§ã³ããorg ã§æå®ããã絶対ã¢ãã¬ã¹ã«
    éç½®ãã¾ãã è¤æ°ã®ã»ã¯ã·ã§ã³ãéç½®ãããå ´åããã®ãªãã·ã§ã³ã¯ã
    å¿è¦ã«å¿ãã¦ã³ãã³ãã©ã¤ã³ä¸ã«ä½åº¦ã§ãæå®ãããã¨ãã§ãã¾ãã org
    ã¯ãåç¬ã® 16 é²æ°ã§ãªããã°ãªãã¾ããã
    ä»ã®ãªã³ã«ã¨ã®äºææ§ã®ããã«ã16 é²æ°ã®åé ã«é常ã¤ãã 0x ã
    çç¥ãããã¨ãã§ãã¾ãã sectionname ã¨çå· (‘‘=’’)ãorg ã®éã«ã¯
    空ç½ãã¯ãããã¨ãã§ããªããã¨ã«æ³¨æãã¦ãã ããã

−Tbss org

−Tdata org











                            ‐22‐


−Ttext org
    −−section−start ã¨åãã§ãã ãããã ".bss", ".data", ".text" ã
    sectionname ã¨ãã¾ãã

−−unresolved−symbols=method
    æªè§£æ±ºã®ã·ã³ãã«ãã©ã®ããã«æ±ããã決å®ãã¾ãã method
    ãåãå¾ãå¤ã¯ 4 種é¡ããã¾ãã

    ignore‐all
        æªè§£æ±ºã·ã³ãã«ãä¸åå ±åãã¾ããã

    report‐all
        æªè§£æ±ºã·ã³ãã«ã®ãã¹ã¦ãå ±åãã¾ãã ãããããã©ã«ãã§ãã

    ignore‐in‐object‐files
        å±æã©ã¤ãã©ãªãå«ãæªè§£æ±ºã·ã³ãã«ãå ±åãã¾ããã
        é常ãªãã¸ã§ã¯ããã¡ã¤ã«ã«ç±æ¥ããå ´åã¯ç¡è¦ãã¾ãã

    ignore‐in‐shared‐libs
        é常ãªãã¸ã§ã¯ããã¡ã¤ã«ã«ç±æ¥ããæªè§£æ±ºã·ã³ãã«ãå ±åãã¾ããã
        å±æã©ã¤ãã©ãªã«ç±æ¥ããå ´åã¯ç¡è¦ãã¾ãã
        åçãã¤ããªãçæããå ´åã«æçãªå ´åãããããã®å ´åã
        åçãã¤ããªãåç§ãã¹ãå±æã©ã¤ãã©ãªãã¹ã¦ããªã³ã«ã®ã³ãã³ãè¡ã«
        å«ãã¦ããå¿è¦ããããã¨ãç¥ããã¦ãã¾ãã

        å±æã©ã¤ãã©ãªããèªèº«ã«å¯¾ããåä½ã¯
        −−[no−]allow−shlib−undefined ãªãã·ã§ã³ã
        使ããã¨ã§ãã¾ãå¶å¾¡ã§ãã¾ãã

        é常ããªã³ã«ã¯ã
        æªè§£æ±ºã·ã³ãã«ã®å ±åããããã«ãããã¦ã¨ã©ã¼ã¡ãã»ã¼ã¸ãçæãã¾ããã
        ãªãã·ã§ã³ −−warn−unresolved−symbols ã«ããã ã¨ã©ã¼ãè‐
        ¦åã«å¤æ´ãããã¨ãã§ãã¾ãã

−−dll−verbose

−−verbose
    ld ã®ãã¼ã¸ã§ã³çªå·ã¨ããµãã¼ããã¦ãããªã³ã«ã¨ãã¥ã¬ã¼ã·ã§ã³ã®
    ä¸è¦§ã表示ãã¾ãã ã¾ããã©ã®å¥åãã¡ã¤ã«ããªã¼ãã³ã§ãã¦ã
    ã©ã®å¥åãã¡ã¤ã«ããªã¼ãã³ã§ããªãã®ãã表示ãã¾ãã
    ããã«ã使ç¨ããããªã³ã«ã¹ã¯ãªããã表示ãã¾ãã

−−version−script=version‐scriptfile
    ãªã³ã«ã«ããã¼ã¸ã§ã³ã¹ã¯ãªããåãæå®ãã¾ãã
    ããã¯é常ãå±æã©ã¤ãã©ãªãçæããéã«ä½¿ãããçæããã©ã¤ãã©ãªã®
    ãã¼ã¸ã§ã³é層ã«ã¤ãã¦ã®ä»å çãªæå ±ãæå®ãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãå±æã©ã¤ãã©ãªããµãã¼ããã ELF
    ãã©ãããã©ã¼ã ä¸ã§ã®ã¿æå³ãããã¾ãã

−−warn−common
    ã³ã¢ã³ã·ã³ãã«ããå¥ã®å±æã·ã³ãã«ãã·ã³ãã«å®ç¾©ã¨çµã³ã¤ããããæã«
    è¦åãåºãã¾ãã Unix
    ã®ãªã³ã«ã¯ããã®ã¡ãã£ã¨ããå æ¸ãªæ£ç¿ã許ãã¦ãã¾ããã
    ä»ã®ãªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ä¸ã®ãªã³ã«ã¯ã許ãã¦ãã¾ããã









                            ‐23‐


    ãã®ãªãã·ã§ã³ãæå®ããã¨ãã°ãã¼ãã«ã·ã³ãã«ãçµã³ã¤ãããããã¨ããæ¥ã
    æ½å¨çãªåé¡ãçºè¦ãããã¨ãã§ãã¾ãã æ®å¿µãªãã¨ã«ãC
    ã©ã¤ãã©ãªã®ä¸ã«ã¯ãã®æ£ç¿ã使ç¨ãã¦ãããã®ãããã ããã°ã©ã ä¸‐
    ã ãã§ãªãã©ã¤ãã©ãªä¸ã®ã·ã³ãã«ã«å¯¾ãã¦ãã ãã®è‐
    ¦åãåºããããã¨ãããã¾ãã

    ã°ãã¼ãã«ã·ã³ãã«ã«ã¯ 3 種é¡ããã¾ãã 以ä¸ã§ C
    è¨èªã®ä¾ã使ã£ã¦èª¬æãã¾ãã

    int i = 1;
        å®ç¾©ã§ãã åºåãã¡ã¤ã«ä¸‐
        ã®åæåæ¸ã¿ãã¼ã¿ã»ã¯ã·ã§ã³ã«ç½®ããã¾ãã

    extern int i;
        æªå®ç¾©åç§ã§ãã ã¡ã¢ãªã¯å²ãå½ã¦ããã¾ããã
        ãã®å¤æ°ã«å¯¾ããå®ç¾©ãã³ã¢ã³ã·ã³ãã«ããã©ããã«ãªãã¦ã¯ãªãã¾ããã

    int i;
        ã³ã¢ã³ã·ã³ãã«ã§ãã å¤æ°ã«å¯¾ãã¦ã(1 ã¤ãããã¯è¤æ°ã®)
        ã³ã¢ã³ã·ã³ãã«ãããªãå ´åã
        åºåãã¡ã¤ã«ã®éåæåãã¼ã¿é åã«ç½®ããã¾ãã
        ãªã³ã«ã¯ãåãå¤æ°ã«å¯¾ããè¤æ°ã®ã³ã¢ã³ã·ã³ãã«ãã1
        ã¤ã®ã³ã¢ã³ã·ã³ãã«ã¸ã¨ ã¾ã¨ãã¾ãã
        ãããã®ãµã¤ãºãç°ãªã£ã¦ããå ´åãæã大ããªãµã¤ãºã®é åãåããã¾ãã
        åãå¤æ°ã«å¯¾ãã¦å®ç¾©ããã£ãå ´åããªã³ã«ã¯å±æã·ã³ãã«ã宣è¨ã«å¤æãã¾ãã

        −−warn−common ãªãã·ã§ã³ãæå®ããã¨ã ãªã³ã«ã¯ 5
        種é¡ã®è¦åãåºãã¾ãã ããããã®è¦åã¯ã2 è¡ãããªã£ã¦ãã¾ãã
        æåã®è¡ã¯ãä»åºä¼ã£ãã·ã³ãã«ã説æãã¦ããã
        次ã®è¡ã¯ã以åã«åãååã§åºä¼ã£ãã·ã³ãã«ã説æãã¾ãã 2
        ã¤ã®ã·ã³ãã«ã®çæ¹ããããã¯ä¸¡æ¹ã¯ãã³ã¢ã³ã·ã³ãã«ã§ãã

    1.  ã·ã³ãã«ã«å¯¾ããå®ç¾©ãæ¢ã«åå¨ããããã
        ã³ã¢ã³ã·ã³ãã«ãåç§ã«å¤æãã¾ãã

                <file>(<section>): warning: common of ‘<symbol>’
                   overridden by definition
                <file>(<section>): warning: defined here

    2.  ã·ã³ãã«ã«å¯¾ããå®ç¾©ãå¾ããç¾ããããã
        ã³ã¢ã³ã·ã³ãã«ãåç§ã«å¤æãã¾ãã
        ããã¯ä¸è¨ã®ã±ã¼ã¹ã¨åæ§ã§ãããã·ã³ãã«ã®ç¾ããé çªãéãã¾ãã

                <file>(<section>): warning: definition of ‘<symbol>’
                   overriding common
                <file>(<section>): warning: common is here

    3.  ã³ã¢ã³ã·ã³ãã«ããæ¢åºã®åããµã¤ãºã®ã³ã¢ã³ã·ã³ãã«ã«ãã¼ã¸ãã¾ãã

                <file>(<section>): warning: multiple common
                   of ‘<symbol>’
                <file>(<section>): warning: previous common is here











                            ‐24‐


    4.  ã³ã¢ã³ã·ã³ãã«ããæ¢åºã®ããã大ããã³ã¢ã³ã·ã³ãã«ã«ãã¼ã¸ãã¾ãã

                <file>(<section>): warning: common of ‘<symbol>’
                   overridden by larger common
                <file>(<section>): warning: larger common is here

    5.  ã³ã¢ã³ã·ã³ãã«ããæ¢åºã®ãããå°ããã³ã¢ã³ã·ã³ãã«ã«ãã¼ã¸ãã¾ãã
        ããã¯ä¸è¨ã®ã±ã¼ã¹ã¨åæ§ã§ãããã·ã³ãã«ã®ç¾ããé çªãéãã¾ãã

                <file>(<section>): warning: common of ‘<symbol>’
                   overriding smaller common
                <file>(<section>): warning: smaller common is here

−−warn−constructors
    ã°ãã¼ãã«ã³ã³ã¹ãã©ã¯ã¿ã 1 ã¤ã§ã使ããã¦ããå ´åãè¦åãåºãã¾ãã
    ãããå½¹ã«ç«ã¤ãã¡ã¤ã«å½¢å¼ã¯ãããã§ãã COFF ã ELF
    ã®ãããªå½¢å¼ã§ã¯ã ãªã³ã«ã¯ã°ã‐
    ã¼ãã«ã³ã³ã¹ãã©ã¯ã¿ã使ç¨ããã¦ãããã¨ãæ¤ç¥ã§ãã¾ããã

−−warn−multiple−gp
    è¤æ°ã®ã°ãã¼ãã«ãã¤ã³ã¿å¤ãåºåãã¡ã¤ã«ä¸ã§å¿è¦ã¨ãããå ´åã è‐
    ¦åãåºãã¾ãã ãã®ãªãã·ã§ã³ã¯ãAlpha ãªã©ã®ç¹å®ã®ãã‐
    ã»ããµã§ã®ã¿æå³ãããã¾ãã å·ä½çã«è¨ãã¨ãããã»ããµã®ä¸‐
    ã«ã¯ç¹å¥ãªã»ã¯ã·ã§ã³ä¸ã« 大ããªå¤ã®å®æ°ãç½®ããã®ãããã¾ãã
    ããç¹æ®ãªã¬ã¸ã¹ã¿ (ã°ãã¼ãã«ãã¤ã³ã¿) ããã®ã»ã¯ã·ã§ã³ã®ä¸‐
    央ã
    æãã¦ããããã¼ã¹ã¬ã¸ã¹ã¿ç¸å¯¾ã®ã¢ãã¬ãã·ã³ã°ã¢ã¼ãã使ç¨ãã¦ã
    å®æ°ãå¹ççã«èªã¿è¾¼ããã¨ãã§ãã¾ãã
    ãã¼ã¹ã¬ã¸ã¹ã¿ç¸å¯¾ã¢ã¼ãã®ãªãã»ããããåºå®ã§æ¯è¼çå°ãã (ä¾ãã°
    16bit) ãããããã«ãã£ã¦å®æ°é åã®æ大ãµã¤ãºã å¶éããã¦ãã¾ãã¾ãã
    å¾ã£ã¦ã大ããªããã°ã©ã ã§ã¯ããã¹ã¦ã®å®æ°ãåç§ããããã«
    è¤æ°ã®ã°ãã¼ãã«ãã¤ã³ã¿å¤ã使ããã¨ããã°ãã°å¿è¦ã¨ãªãã¾ãã
    ãã®ãªãã·ã§ã³ãæå®ããã¨ããã®ãããªã±ã¼ã¹ãèµ·ããæã«è¦åãåºãã¾ãã

−−warn−once
    ããããã®æªå®ç¾©ã·ã³ãã«ã«å¯¾ãã¦ããããåç§ãã¦ããã¢ã¸ã¥ã¼ã«ãã¨ã«
    è¦åãåºãã®ã§ã¯ãªãããã  1 度ã ãè¦åãåºãã¾ãã

−−warn−section−align
    ã¢ã©ã¤ã³ã¡ã³ãã«ãã£ã¦åºåã»ã¯ã·ã§ã³ã®ã¢ãã¬ã¹ãå¤æ´ãããå ´åã
    è¦åãåºãã¾ãã
    ä¸è¬çã«ã¯ãã¢ã©ã¤ã³ã¡ã³ãã¯ã¤ã³ãããã»ã¯ã·ã§ã³ã«ããè¨å®ããã¾ãã
    ã¢ãã¬ã¹ãå¤æ´ãããã®ã¯ããããæ示çã«æå®ãããªãã£ãå ´åã ãã§ãã
    ããªãã¡ã"SECTIONS" ã³ãã³ããããã®ã»ã¯ã·ã§ã³ã®
    éå§ã¢ãã¬ã¹ãæå®ããªãã£ãå ´åã§ãã

−−warn−unresolved−symbols
    ãªã³ã«ãæªè§£æ±ºã·ã³ãã«ãå ±åãããã¨ããã¨ã (ãªãã·ã§ã³
    −−unresolved−symbols ãåç§)ãæ®éã¯ã¨ã©ã¼ãçæãã¾ãã
    ãã®ãªãã·ã§ã³ã¯ãã¨ã©ã¼ã®ä»£ããã«è¦åãçæãã¾ãã

−−error−unresolved−symbols
    ããã¯ãªã³ã«ã®ããã©ã«ãã®åä½ã§ãæªè§£æ±ºã·ã³ãã«ãå ±åãããã¨
    ããã¨ãã¨ã©ã¼ãçæãã¾ãã









                            ‐25‐


−−whole−archive
    ã³ãã³ãã©ã¤ã³ä¸ã§ −−whole−archive ãªãã·ã§ã³ã®å¾ã«
    æå®ãããåã¢ã¼ã«ã¤ãã«å¯¾ãã¦ããã®ã¢ã¼ã«ã¤ããã¡ã¤ã«ã®ä¸ã®å¿è¦ãª
    ãªãã¸ã§ã¯ããã¡ã¤ã«ã ããæ¤ç´¢ããã®ã§ã¯ãªããã¢ã¼ã«ã¤ãä¸ã®
    ãã¹ã¦ã®ãªãã¸ã§ã¯ãããªã³ã¯ã«å«ãã¾ãã
    ããã¯ã¢ã¼ã«ã¤ããå±æã©ã¤ãã©ãªã«å¤æããæã«æ®é使ç¨ããã
    çæããå±æã©ã¤ãã©ãªä¸‐
    ã«ãã¹ã¦ã®ãªãã¸ã§ã¯ããå¼·å¶çã«åãè¾¼ã¿ã¾ãã ãã®ãªãã·ã§ã³ã¯ã2
    å以ä¸ä½¿ç¨ãã¦ãæ§ãã¾ããã

    ãã®ãªãã·ã§ã³ã gcc ãã使ç¨ããéã«ã2 ã¤æ³¨æãããã¨ãããã¾ãã 1
    ã¤ãã¯ãgcc ã¯ãã®ãªãã·ã§ã³ãç¥ãã¾ããã
    ã§ãããã−Wl,−whole−archive ã¨æå®ããªããã°ãªãã¾ããã 2
    ã¤ãã¯ãã¢ã¼ã«ã¤ãããªã¹ãããå¾ −Wl,−no−whole−archive ã
    使ããã¨ãå¿ããªãããã«ãã¦ãã ããã ã¨ããã®ã¯ãgcc
    ã¯èªåã§ã¢ã¼ã«ã¤ãã®ãªã¹ãããªã³ã¯ã«è¿½å ãããã¨ã
    ããã®ã§ãããã«ããå½±é¿ãåããªãããã«ããå¿è¦ãããããã§ãã

−−wrap symbol
    symbol ã«å¯¾ãã¦ãã©ããé¢æ°ã使ç¨ãã¾ãã ãã¹ã¦ã® symbol
    ã¸ã®æªå®ç¾©åç§ã¯ã "__wrap_symbol" ã¸ã¨è§£æ±ºããã¾ãã
    ãã¹ã¦ã® "__real_symbol" ã¸ã® æªå®ç¾©åç§ã¯ãsymbol
    ã¸ã¨è§£æ±ºããã¾ãã

    ããã«ãã£ã¦ãã·ã¹ãã é¢æ°ã«å¯¾ããã©ãããç¨æã§ãã¾ãã
    ã©ããé¢æ°ã¯ã"__wrap_symbol" ã¨ãã ååã«ããå¿è¦ãããã¾ãã
    ã©ããé¢æ°ãã·ã¹ãã é¢æ°ãå¼ã³ããæã«ã¯ã "__real_symbol"
    ãå¼ã³åºãããã«ãã¾ãã

    以ä¸ã«ç°¡åãªä¾ã示ãã¾ã:

            void *
            __wrap_malloc (size_t c)
            {
              printf ("malloc called with %zd\n", c);
              return __real_malloc (c);
            }

    −−wrap malloc ã使ç¨ãã¦ããã®ãã¡ã¤ã«ã¨ä¸ç·ã«ä»ã®ã³ã¼ãã
    ãªã³ã¯ããå ´åããã¹ã¦ã® "malloc" å¼ã³åºãã¯ã é¢æ°
    "__wrap_malloc" ã代ããã«å¼ã³åºãã¾ãã "__wrap_malloc" ä¸ã®
    "__real_malloc" ãã æ¬å½ã® "malloc" é¢æ°ãå¼ã³åºãã¾ãã

    åæ§ã«ã㦠"__real_malloc" é¢æ°ãç¨æãã¦ããã¨ã −−wrap
    ãªãã·ã§ã³ãæå®ãããªãã£ãå ´åã«ããªã³ã¯ã¯æåãã¾ãã
    ãã®å ´åã«ã¯ã"__real_malloc" ã®å®ç¾©ã "__wrap_malloc"
    ã¨åããã¡ã¤ã«ã«ããã¦ã¯ããã¾ããã ãã®ããã«ããã¨ããªã³ã«ãããã
    "malloc" ã¸ã¨
    ã©ããããåã«ãã¢ã»ã³ãã©ããã®å¼ã³åºãã解決ãã¦ãã¾ãããããã¾ããã

−−enable−new−dtags

−−disable−new−dtags
    ãã®ãªã³ã«ã¯ãELF ã·ã¹ãã ã®æ°ããåçã¿ã°ãçæãããã¨ãã§ãã¾ãã









                            ‐26‐


    ãããå¤ã ELF ã·ã¹ãã ã¯ãããããç解ã§ããªãå ´åãããã¾ãã
    −−enable−new−dtags ãæå®ããå ´åã
    åçã¿ã°ã¯å¿è¦ã«å¿ãã¦ä½æããã¾ãã −−disable−new−dtags
    ãæå®ããå ´åã¯ã æ°ããåçã¿ã°ã¯ä½æããã¾ããã
    ããã©ã«ãã§ã¯ãæ°ããåçã¿ã°ã¯ä½æããã¾ããã ãããã®ãªãã·ã§ã³ã¯ãELF
    ã·ã¹ãã ä¸ã§ã®ã¿å©ç¨å¯è½ã§ãããã¨ã« 注æãã¦ãã ããã

     i386 PE ãªã³ã«ã¯ã−shared ãªãã·ã§ã³ããµãã¼ããã¦ãã¾ãã
ãããæå®ããã¨ãé常ã®å®è¡å½¢å¼ã§ã¯ãªã åçãªã³ã¯ã©ã¤ãã©ãª (DLL)
ãåºåãã¾ãã ãã®ãªãã·ã§ã³ã使ç¨ããæã«ã¯ãååã "*.dll" ã¨
ããå¿è¦ãããã¾ãã ããã«å ãããªã³ã«ã¯æ¨æºã® "*.def" ãã¡ã¤ã«ãå®å¨ã«
ãµãã¼ããã¦ããããªãã¸ã§ã¯ããã¡ã¤ã«ã¨åæ§ã«ãªã³ã«ã®ã³ãã³ãã©ã¤ã³ä¸ã§
æå®ã§ãã¾ã
(å®éãã·ã³ãã«ãã¨ã¯ã¹ãã¼ããã¦ããã¢ã¼ã«ã¤ãã®åã«ç½®ãã¦ãé常ã®
ãªãã¸ã§ã¯ããã¡ã¤ã«ã¨åæ§ã«ãªã³ã¯ããããã¨ãä¿è¨¼ããå¿è¦ãããã¾ã)ã

     ãã¹ã¦ã®ã¿ã¼ã²ããã«å±éã®ãªãã·ã§ã³ã«å ããi386 PE
ã®ãªã³ã«ã¯ã i386 PE ã¿ã¼ã²ããã«åºæã®ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã
追å ã§ãµãã¼ããã¦ãã¾ãã å¤ãåããªãã·ã§ã³ã¯ã1 ã¤ã®ç©ºç½ãç‐
å·ã§å¤ã¨ã®éãåºåãã¾ãã

−−add−stdcall−alias
    ãã®ãªãã·ã§ã³ãæå®ãããå ´åãstdcall ãµãã£ãã¯ã¹ (@nn) ãæã¤
    ã·ã³ãã«ãããã®ã¾ã¾ãµãã£ãã¯ã¹ãåã£ã¦ã¨ã¯ã¹ãã¼ããã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−base−file file
    dlltool ã使ç¨ã㦠DLL ãçæããã®ã«å¿è¦ãªãã¹ã¦ã®åéç½®æå ±ã®
    ãã¼ã¹ã¢ãã¬ã¹ãã»ã¼ããããã¡ã¤ã«åã file ã¨ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ç¹æã§ã]

−−dll
    é常ã®å®è¡å½¢å¼ã®ä»£ããã« DLL ãçæãã¾ãã −shared
    ã使ç¨ãããã¨ãã§ãã¾ãããæå®ãã ".def" ãã¡ã¤ã«ä¸ã§ "LIBRARY" ã
    使ç¨ãããã¨ãã§ãã¾ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−enable−stdcall−fixup

−−disable−stdcall−fixup
    解決ä¸è½ãªã·ã³ãã«ãè¦ã¤ããã¨ããªã³ã«ã¯ãææ§ãªã³ã¯ãã試ã¿ã¾ãã
    ããã¯ãã·ã³ãã«åã®å½¢å¼ (cdecl 対 stdcall)
    ã ããç°ãªãå¥ã®å®ç¾©æ¸ã¿ã®
    ã·ã³ãã«ãæ¢ããä¸è´ãããã®ã¸ã¨ãªã³ã¯ãããã¨ã§ã·ã³ãã«ã解決ãã¾ãã
    ä¾ãã°ãæªå®ç¾©ã·ã³ãã« "_foo" ã¯ãé¢æ° "_foo@12"
    ã¸ã¨ãªã³ã¯ãããæªå®ç¾©ã·ã³ãã« "_bar@16" ã¯ãé¢æ° "_bar"
    ã¸ã¨ ãªã³ã¯ãããããç¥ãã¾ããã ãªã³ã«ããããè¡ãéã«ãè‐
    ¦åã表示ãã¾ãã
    ã¨ããã®ã¯ãé常ã¯ãªã³ã¯ã«å¤±æããã¹ãã§ããããã§ãã
    ãããããµã¼ããã¼ãã£ã® DLL ããçæãããã¤ã³ãã¼ãã©ã¤ãã©ãªã
    使ç¨ããã®ã«ããã®æ©è½ãæãå¿è¦ã¨ãªããã¨ãããã¾ãã
    −−enable−stdcall−fixup ãæå®ããå ´åããã®æ©è½ã¯
    å®å¨ã«æå¹åãããè¦åã¯åºåããã¾ããã −−disable−stdcall−fixup









                            ‐27‐


    ãæå®ããå ´åããã®æ©è½ã¯
    ç¡å¹åããããã®ãããªä¸ä¸è´ã¯ã¨ã©ã¼ã¨ã¿ãªããã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−export−all−symbols
    ãã®ãªãã·ã§ã³ãæå®ãããã¨ãDLL ãæ§ç¯ããã®ã«ä½¿ããã
    ãªãã¸ã§ã¯ãä¸ã®ãã¹ã¦ã®ã°ãã¼ãã«ã·ã³ãã«ããDLL ã«ãã£ã¦
    ã¨ã¯ã¹ãã¼ãããã¾ãã
    ããã¯ãããããªããã°ã¨ã¯ã¹ãã¼ããããã·ã³ãã«ãå¨ããªãå ´åã
    ããã©ã«ãã¨ãªããã¨ã«æ³¨æãã¦ãã ããã ã·ã³ãã«ã DEF
    ãã¡ã¤ã«ã«ãã£ã¦æ示çã«ã¨ã¯ã¹ãã¼ããããå ´åã
    é¢æ°å±æ§ã«ãã£ã¦æé»ã«ã¨ã¯ã¹ãã¼ããããå ´åã¯ããã®ãªãã·ã§ã³ã
    æå®ãããªãéããããã©ã«ãã§ã¯ä»ã«ã¯ä½ãã¨ã¯ã¹ãã¼ãããã¾ããã ã·ã³ãã«
    "DllMain@12", "DllEntryPoint@0", "DllMainCRTStartup@12",
    "impure_ptr" ã¯ã èªåçã«ã¯ã¨ã¯ã¹ãã¼ãããã¾ããã ä»ã® DLL
    ããã¤ã³ãã¼ããããã·ã³ãã«ããåã³ã¨ã¯ã¹ãã¼ãããã¾ãããã "_head_"
    ã§å§ã¾ã£ãã "_iname" 㧠çµããããªãDLL
    ã®åé¨ã¬ã¤ã¢ã¦ããæå®ããã·ã³ãã«ãã¨ã¯ã¹ãã¼ãããã¾ããã
    ããã«ã"libgcc", "libstd++", "libmingw32", "crtX.o" ããã®
    ã·ã³ãã«ãã¨ã¯ã¹ãã¼ãããã¾ããã "__rtti_" ã "__builtin_" ã§
    å§ã¾ãååã®ã·ã³ãã«ããC++ DLL ã®ããã«ã¨ã¯ã¹ãã¼ãããã¾ããã
    æå¾ã«ãã¨ã¯ã¹ãã¼ããããªã Cygwin ã®éå¬éã·ã³ãã«ã®
    æ¡å¼µããããªã¹ããããã¾ã (æããã«ããã㯠Cygwin ã¿ã¼ã²ããç¨ã® DLL
    ãæ§ç¯ããæã«é©ç¨ããã¾ã)ã ããã Cygwin
    ã®é¤å¤ãããã·ã³ãã«ã¯ä»¥ä¸ã®éãã§ãã "_cygwin_dll_entry@12",
    "_cygwin_crt0_common@8",
    "_cygwin_noncygwin_dll_entry@12", "_fmode",
    "_impure_ptr", "cygwin_attach_dll", "cygwin_premain0",
    "cygwin_premain1", "cygwin_premain2", "cygwin_premain3"
    ãã㦠"environ" ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−exclude−symbols symbol,symbol,...
    èªåçã«ã¨ã¯ã¹ãã¼ããã¹ãã§ã¯ãªãã·ã³ãã«ã®ãªã¹ããæå®ãã¾ãã
    ãããã®ã·ã³ãã«åã¯ãã³ã³ããããã¯ã³ãã³ã§åºåããã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−exclude−libs lib,lib,...
    ã·ã³ãã«ãèªåçã«ã¨ã¯ã¹ãã¼ãããªãã¢ã¼ã«ã¤ãã©ã¤ãã©ãªã®ãªã¹ããæå®ãã¾ãã
    ã©ã¤ãã©ãªåã¯ã³ã³ããã³ãã³ã§åºåãã¾ãã "−−exclude−libs ALL"
    ã¨æå®ããã¨ã
    èªåã¨ã¯ã¹ãã¼ãã®ãã¹ã¦ã®ã¢ã¼ã«ã¤ãã©ã¤ãã©ãªããã·ã³ãã«ãé¤å»ãã¾ãã
    æ示çã« .def
    ãã¡ã¤ã«ã«ãªã¹ããããã·ã³ãã«ã¯ãæ¬ãªãã·ã§ã³ã«ãããããã
    ä¾ç¶ã¨ãã¦ã¨ã¯ã¹ãã¼ãããã¾ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−file−alignment
    ãã¡ã¤ã«ã®ã¢ã©ã¤ã³ã¡ã³ããæå®ãã¾ãã ãã¡ã¤ã«ä¸‐
    ã®ã»ã¯ã·ã§ã³ã¯ã常ã«ãã®åæ°ã®ãã¡ã¤ã«ãªãã»ãããã å§ã¾ãã¾ãã
    ããã©ã«ã㯠512 ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]









                            ‐28‐


−−heap reserve

−−heap reserve,commit
    ãã®ããã°ã©ã ã®ãã¼ãé åã«ä½¿ãããã«äºç´ãã
    (ãªãã·ã§ã³ã§ã³ããããã) ã¡ã¢ãªéãæå®ãã¾ãã ããã©ã«ãã§ã¯ 1Mb
    ãäºç´ããã4K ãã³ãããããã¾ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−image−base value
    ããã°ã©ã ããã㯠DLL ã®ãã¼ã¹ã¢ãã¬ã¹ã¨ãã¦ãvalue ã使ç¨ãã¾ãã
    ããã¯ãããã°ã©ã ããã㯠DLL ããã¼ããããæã«ä½¿ãããã
    æãä½ä½ã®ã¡ã¢ãªä½ç½®ã¨ãªãã¾ãã åéç½®ããå¿è¦æ§ã軽æ¸ããDLL
    ã®æ§è½ãåä¸ããããããå DLL 㯠ä¸æãªãã¼ã¹ã¢ãã¬ã¹ãæã¡ãä»ã® DLL
    ã¨éãªããªãããã«ãã¹ãã§ãã ããã©ã«ãã§ã¯ãå®è¡å½¢å¼ã¯ 0x400000
    ã§ãDLL 㯠0x10000000 ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−kill−at
    ãã®ãªãã·ã§ã³ãæå®ãããã¨ãstdcall ã®ãµãã£ãã¯ã¹ (@nn) ã¯ã
    ã¨ã¯ã¹ãã¼ããããåã«ã·ã³ãã«ããåãé¤ããã¾ãã [ãã®ãªãã·ã§ã³ã¯ i386
    PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−major−image−version value
    ãã¤ã¡ã¼ã¸ãã¼ã¸ã§ã³ãã®ã¡ã¸ã£ã¼ãã³ããè¨å®ãã¾ãã ããã©ã«ã㯠1
    ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−major−os−version value
    ãOS ãã¼ã¸ã§ã³ãã®ã¡ã¸ã£ã¼ãã³ããè¨å®ãã¾ãã ããã©ã«ã㯠4 ã§ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−major−subsystem−version value
    ããµãã·ã¹ãã ãã¼ã¸ã§ã³ãã®ã¡ã¸ã£ã¼ãã³ããè¨å®ãã¾ãã ããã©ã«ãã¯
    4 ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−minor−image−version value
    ãã¤ã¡ã¼ã¸ãã¼ã¸ã§ã³ãã®ãã¤ããã³ããè¨å®ãã¾ãã ããã©ã«ã㯠0 ã§ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−minor−os−version value
    ãOS ãã¼ã¸ã§ã³ãã®ãã¤ããã³ããè¨å®ãã¾ãã ããã©ã«ã㯠0 ã§ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−minor−subsystem−version value
    ããµãã·ã¹ãã ãã¼ã¸ã§ã³ãã®ãã¤ããã³ããè¨å®ãã¾ãã ããã©ã«ã㯠0
    ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−output−def file
    ãªã³ã«ã¯ãçæãã DLL ã«å¯¾å¿ãã DEF ãã¡ã¤ã«ãå«ã ãã¡ã¤ã« file









                            ‐29‐


    ãä½æãã¾ãã ãã® DEF ãã¡ã¤ã« ("*.def" ã¨å¼ã°ãã¾ã) ã¯ã
    "dlltool" ã使ã£ã¦ã¤ã³ãã¼ãã©ã¤ãã©ãªã®ä½æã«
    使ç¨ãããããèªåçã«ãããã¯æé»ã«ã¨ã¯ã¹ãã¼ããããã·ã³ãã«ã¸ã®
    åç§ã¨ãã¦ä½¿ç¨ãããããã¾ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−out−implib file
    ãªã³ã«ã¯ãçæãã DLL ã«å¯¾å¿ããã¤ã³ãã¼ãã©ã¤ãã©ãªãå«ã ãã¡ã¤ã«
    file ãä½æãã¾ãã ãã®ã¤ã³ãã¼ãã©ã¤ãã©ãª ("*.dll.a" ãããã¯
    "*.a" ã¨å¼ã°ãã¾ã) ã¯ã çæããã DLL
    ãã¯ã©ã¤ã¢ã³ãã«ãªã³ã¯ããã®ã«ä½¿ããã¾ãã
    ãã®åä½ã«ãã£ã¦ãå¥ã«è¡ã "dlltool" ã®
    ã¤ã³ãã¼ãã©ã¤ãã©ãªä½æã¹ããããé£ã°ããã¨ãã§ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−enable−auto−image−base
    "−−image−base" å¼æ°ã«ãã£ã¦æå®ãããªãã£ã DLL ã®
    ã¤ã¡ã¼ã¸ãã¼ã¹ãèªåçã«é¸æãã¾ãã DLL
    åããçæãããããã·ã¥å¤ã使ããã¨ã«ãããå DLL ã«å¯¾ãã¦
    ä¸æã®ã¤ã¡ã¼ã¸ãã¼ã¹ãä½æãããããã°ã©ã ã®å®è¡ãé延ããã
    ã¡ã¢ãªåã§ã®è¡çªã¨åéç½®ãåé¿ãããã¨ãã§ãã¾ãã [ãã®ãªãã·ã§ã³ã¯
    i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−disable−auto−image−base
    ä¸æãªã¤ã¡ã¼ã¸ãã¼ã¹ãèªåçã«ä½æãã¾ããã
    ã¦ã¼ã¶ããæå®ãããã¤ã¡ã¼ã¸ãã¼ã¹ ("−−image−base") ã
    ãªãå ´åããã©ãããã©ã¼ã ã®ããã©ã«ãã使ç¨ãã¾ãã [ãã®ãªãã·ã§ã³ã¯
    i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−dll−search−prefix string
    ã¤ã³ãã¼ãã©ã¤ãã©ãªã使ããã« DLL ãåçã«ãªã³ã¯ããéã«ã
    "lib<basename>.dll" ããã "<string><basename>.dll"
    ãåã«æ¤ç´¢ãã¾ãã ãã®åä½ã«ãã£ã¦ãæ§ã㪠"subplatforms"
    ç¨ã«ä½ããã native, cygwin, uwin, pw ãªã©ã® DLL
    ãã容æã«åºå¥ãããã¨ãã§ãã¾ãã ä¾ãã°ãä¸è¬çã« Cygwin ã® DLL
    ã¯ã "−−dll−search−prefix=cyg" ã使ç¨ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−enable−auto−import
    DLL ããã¤ã³ãã¼ããããã¼ã¿ã«å¯¾ãã¦ã"_symbol" ã
    "__imp__symbol" ã¸ã¨æã®è¾¼ãã ãªã³ã¯ããã ãããã® DATA
    ã¨ã¯ã¹ãã¼ããæã¤ã¤ã³ãã¼ãã©ã¤ãã©ãªã® æ§ç¯ã«éãã¦ã
    å¿è¦ã«å¿ãã¦ãµã³ã¯ (thunk) ããã·ã³ãã«ãä½æãã¾ãã 注æ:
    ’auto−import’ æ¡å¼µæ©è½ã®ä½¿ç¨ã¯ã¤ã¡ã¼ã¸ãã¡ã¤ã«ã® ãã‐
    ã¹ãã»ã¯ã·ã§ã³ãæ¸ãè¾¼ã¿å¯è½ã«ãã¦ãã¾ãã¾ãã ãã㯠Microsoft
    ãçºè¡ãã¦ãã PE‐COFF å½¢å¼ä»æ§ã«é©åãã¾ããã

    ä¸è¬çã«ã’auto−import’ ã®ä½¿ç¨ã¯ãåã«ãã¾ãããã¾ãã ‐‐
    ãããã以ä¸ã®ãããªã¡ãã»ã¼ã¸ãåºããã¨ãããã¾ãã

    "variable ’<var>’ can’t be auto−imported. Please read
    the documentation for ld’s "−−enable−auto−import" for









                            ‐30‐


    details."

    ãã®ã¡ãã»ã¼ã¸ã¯ãæçµçã« 2
    ã¤ã®å®æ°ã®åã«ãã£ã¦æå®ãããã¢ãã¬ã¹ã«
    ã¢ã¯ã»ã¹ãã(ãµã)å¼ãããå ´åã«çºçãã¾ã (Win32
    ã¤ã³ãã¼ããã¼ãã«ã¯ã1 ã¤ã®ã¿ãã許ãã¦ãã¾ãã)ã
    ãããèµ·ããå¾ãå ´åã¨ããã®ã¯ãDLL ããã¤ã³ãã¼ããããæ§é ä½å¤æ°ã®
    ãã£ã¼ã«ãã¡ã³ãã¸ã¢ã¯ã»ã¹ããå ´åãã DLL ããã¤ã³ãã¼ãããã
    éåå¤æ°ã«å¯¾ãã¦å®æ°ã®ã¤ã³ããã¯ã¹ã使ç¨ããå ´åãªã©ãããã¾ãã
    ãã¹ã¦ã®è¤æ°ã¯ã¼ãã®å¤æ° (éåãæ§é ä½ãlong long ãªã©) ã¯ã
    ãã®ã¨ã©ã¼æ¡ä»¶ãå¼ãèµ·ãããã¨ãããã¾ãã
    ãããããã®ã¨ã¯ã¹ãã¼ããããç®éããªå¤æ°ããå®éã©ããªãã¼ã¿ã¿ã¤ãã§
    ãã£ã¦ããld 㯠常ã«ãããæ¤ç¥ããè¦åãçºããåæ¢ãã¾ãã

    ã¨ã¯ã¹ãã¼ããããå¤æ°ã®ãã¼ã¿ã¿ã¤ããä½ã§ãããã¨ã
    ãã®åé¡ã解æ¶ããæ¹æ³ãããã¤ãããã¾ãã

    1 ã¤ã®æ¹æ³ã¯ã−−enable−runtime−pseudo−reloc ã¹ã¤ããã
    使ç¨ãããã¨ã§ãã
    ããã¯å®è¡ç°å¢ã®ã¯ã©ã¤ã¢ã³ãã³ã¼ãã«åç§ã®èª¿æ´ã¨ããä»äºã
    æ®ãã¦ãã¾ããã¨ã«ãªãã®ã§ããã®æ¹æ³ã使ããã®ã¯ã
    å®è¡ç°å¢ããã®æ©è½ããµãã¼ããã¦ããå ´åã«éããã¾ãã

    2 çªç®ã®è§£æ±ºçã¯ãå®æ°ã® 1
    ã¤ãå¼·å¶çã«å¤æ°ã¨ãã¦ãã¾ããã¨ã§ãã ‐‐
    ã¤ã¾ããã³ã³ãã¤ã«æã«ä¸æã§æé©åä¸å¯ã¨ãããã¨ã§ãã
    éåã«å¯¾ãã¦ã¯ã2 ã¤ã®æ¹æ³ãèãããã¾ãã a) ã¤ã³ããã¯ã¹ãããå´
    (éåã®ã¢ãã¬ã¹) ãå¤æ°ã¨ãã¾ãã ãããã¯ãb)
    å®æ°ã¤ã³ããã¯ã¹ãå¤æ°ã¨ãã¾ãã å¾ã£ã¦ä»¥ä¸ã®ããã«ãªãã¾ã:

            extern type extern_array[];
            extern_array[1] ‐‐>
               { volatile type *t=extern_array; t[1] }

    ãããã¯

            extern type extern_array[];
            extern_array[1] ‐‐>
               { volatile int t=1; extern_array[t] }

    æ§é ä½ (ããä»ã®ã»ã¨ãã©ã®è¤æ°ã¯ã¼ããã¼ã¿ã¿ã¤ã) ã«å¯¾ãã¦ã¯ã
    æ§é ä½ãã®ãã® (ããã㯠long long ãªã©) ãå¤æ°ã¨ããã®ãã
    å¯ä¸ã®æ¹æ³ã§ãã

            extern struct s extern_struct;
            extern_struct.field ‐‐>
               { volatile struct s *t=&extern_struct; t‐>field }

    ãããã¯

            extern long long extern_ll;
            extern_ll ‐‐>
              { volatile long long * local_ll=&extern_ll; *local_ll }










                            ‐31‐


    ãã®åé¡ãæ±ã 3
    çªç®ã®æ¹æ³ã¯ãç®éããªã·ã³ãã«ããèªåã¤ã³ãã¼ããããã®ã æ‐
    ¢ãã¦ã"__declspec(dllimport)" ã¨å°ãä»ãããã¨ã§ãã
    ãããå®éã«ãããããã«ã¯ãã³ã³ãã¤ã«æã« #define ã使ãã DLL
    ãæ§ç¯ãããã¨ãã¦ããã®ããããã㯠DLL ã¨ãªã³ã¯ãã
    ã¯ã©ã¤ã¢ã³ãã³ã¼ããæ§ç¯ãããã¨ãã¦ããã®ããã¾ãã¯åã«éçã©ã¤ãã©ãªã
    æ§ç¯/ãªã³ã¯ãããã¨ãã¦ããã®ãã示ããªããã°ãªãã¾ããã
    ãå®æ°ãªãã»ãããç¨ããç´æ¥ã¢ãã¬ã¹ãåé¡ã解決ããããã¤ãã®æ¹æ³ã
    é¸æããéã«ãä¸è¬çãªç¾å®ä¸çã§ã®ä½¿ç¨æ¹æ³ãèããªããã°ãªãã¾ãã:

    åã®ã³ã¼ã:

            ‐‐foo.h
            extern int arr[];
            ‐‐foo.c
            #include "foo.h"
            void main(int argc, char **argv){
              printf("%d\n",arr[1]);
            }

    解決ç 1:

            ‐‐foo.h
            extern int arr[];
            ‐‐foo.c
            #include "foo.h"
            void main(int argc, char **argv){
              /* This workaround is for win32 and cygwin; do not "optimize" */
              volatile int *parr = arr;
              printf("%d\n",parr[1]);
            }

    解決ç 2:

            ‐‐foo.h
            /* Note: auto‐export is assumed (no __declspec(dllexport)) */
            #if (defined(_WIN32) ⎪⎪ defined(__CYGWIN__)) && \
              !(defined(FOO_BUILD_DLL) ⎪⎪ defined(FOO_STATIC))
            #define FOO_IMPORT __declspec(dllimport)
            #else
            #define FOO_IMPORT
            #endif
            extern FOO_IMPORT int arr[];
            ‐‐foo.c
            #include "foo.h"
            void main(int argc, char **argv){
              printf("%d\n",arr[1]);
            }

    ãã®åé¡ãåé¿ãã 4 çªç®ã®æ¹æ³ã¯ãç®éããªå¤æ°ã«å¯¾ããã¢ã¯ã»ã¹ãã
    ãã¼ã¿ãç´æ¥ä½¿ãã¤ã³ã¿ãã§ã¼ã¹ã§ã¯ãªããé¢æ°ã®ã¤ã³ã¿ãã§ã¼ã¹ã使ããã
    ã©ã¤ãã©ãªãæ¸ãæãããã¨ã§ã (ä¾ãã° set_foo() 㨠get_foo()
    ã¢ã¯ã»ã¹é¢æ°ã使ãã¾ã)ã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]









                            ‐32‐


−−disable−auto−import
    DLL ããã¤ã³ãã¼ããããã¼ã¿ã«å¯¾ãã¦ã"_symbol" ã
    "__imp__symbol" ã¸ã¨ãæã®è¾¼ãã ãªã³ã¯ã ããªãããã«ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−enable−runtime−pseudo−reloc
    ã³ã¼ãã −−enable−auto−import
    ã»ã¯ã·ã§ã³ã§è¨è¿°ãã表ç¾ãå«ãå ´åã ããªãã¡ã DATA ã DLL
    ããéã¼ããªãã»ãããä»ã㦠ã¤ã³ãã¼ããã¦ããå ´åããã®ã¹ã¤ããã¯
    ’å®è¡æçä¼¼åéç½® (runtime pseudo relocation)’
    ãã¯ã¿ãçæãã¾ãã ãã®ãã¯ã¿ã¯å®è¡ç°å¢ãã¯ã©ã¤ã¢ã³ãã³ã¼ãã®ä¸‐
    ã§ããããã¼ã¿ã®åç§ã 調æ´ããããã«ä½¿ç¨ãããã¨ãã§ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−disable−runtime−pseudo−reloc
    DLL ããã®ãéã¼ããªãã»ããã® DATA ã¤ã³ãã¼ãã«å¯¾ãã
    çä¼¼åéç½®æå ±ãçæããªãããã«ãã¾ãã ããã¯ããã©ã«ãã§ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−enable−extra−pe−debug
    èªåã¤ã³ãã¼ãããã·ã³ãã«ã®ãµã³ã¯ã«é¢ãã¦ãä»å çãªãããã°æå ±ã示ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−section−alignment
    ã»ã¯ã·ã§ã³ã®ã¢ã©ã¤ã³ã¡ã³ããè¨å®ãã¾ãã ã¡ã¢ãªä¸‐
    ã®ã»ã¯ã·ã§ã³ã¯ã常ã«ãã®åæ°ã®ã¢ãã¬ã¹ããå§ã¾ãã¾ãã ããã©ã«ãã¯
    0x1000 ã§ãã [ãã®ãªãã·ã§ã³ã¯ i386 PE
    ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã« ç¹æã®ãã®ã§ã]

−−stack reserve

−−stack reserve,commit
    ããã°ã©ã ã®ã¹ã¿ãã¯ã«ä½¿ãããã«äºç´ãã (ãªãã·ã§ã³ã§ã³ããããã)
    ã¡ã¢ãªéãæå®ãã¾ãã ããã©ã«ãã§ã¯ 2Mb ãäºç´ããã4K ãã³ãããããã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]

−−subsystem which

−−subsystem which:major

−−subsystem which:major.minor
    ããã°ã©ã ãå®è¡ããããµãã·ã¹ãã ãæå®ãã¾ãã which
    ã®å¤ã§æå¹ãªã®ã¯ã"native", "windows", "console" ããã¦
    "posix" ã§ãã
    ãªãã·ã§ã³ã§ããµãã·ã¹ãã ã®ãã¼ã¸ã§ã³ãæå®ãããã¨ãã§ãã¾ãã
    [ãã®ãªãã·ã§ã³ã¯ i386 PE ã¿ã¼ã²ããç¨ç§»æ¤çãªã³ã«ã«
    ç¹æã®ãã®ã§ã]











                            ‐33‐


ç°å¢å¤æ° "GNUTARGET", "LDEMULATION", "COLLECT_NO_DEMANGLE"
ãç¨ãã¦ãld ã® åä½ãå¤æ´ãããã¨ãã§ãã¾ãã

     "GNUTARGET" ã¯ã−b (ãããã¯ãã®å¥åã® −−format)
ãæå®ãããªãã£ãå ´åã
å¥åãã¡ã¤ã«ã®ãªãã¸ã§ã¯ãå½¢å¼ã決å®ããã®ã«ä½¿ç¨ããã¾ãã
ãã®å¤ã¯ãå¥åå½¢å¼ã«å¯¾ãã BFD åã® 1 ã¤ã§ãªãã¦ã¯ãªãã¾ããã
ç°å¢å¤æ° "GNUTARGET" ãå®ç¾©ããã¦ããªãå ´åã ld
ã¯ããã®ã¿ã¼ã²ããã«æãèªç¶ãªå½¢å¼ã使ç¨ãã¾ãã "GNUTARGET" ã
"default" ã« è¨å®ããã¦ããå ´åãBFD ã¯ããã¤ããªå¥åãã¡ã¤ã«ãæ¤æ»ãã¦
ã¤ã³ãããå½¢å¼ã決å®ãããã¨ãã¾ãã
ãã®æ¹æ³ã¯å¤§æµã®å ´åæåãã¾ãããæ½å¨çãªææ§ããæ®ãã¾ãã
ã¨ããã®ã¯ããªãã¸ã§ã¯ããã¡ã¤ã«ã®å½¢å¼ãæå®ããã®ã«ä½¿ããã
ãã¸ãã¯ãã³ããä¸æã§ãããã¨ãä¿è¨¼ããæ¹æ³ããªãããã§ãã
ããããããããã®ã·ã¹ãã ä¸ã§ã® BFD ã®æ§æéç¨ã«ããã¦ã
ãã®ã·ã¹ãã ã®æ£ç¿çãªãã©ã¼ããããæ¤ç´¢ãªã¹ãã®åé ã«ç½®ãããã®ã§ã
ãã®ææ§ãã¯æ£ç¿çãªãã®ã«æå©ã«ãªãããã«è§£æ±ºããã¾ãã

     "LDEMULATION" ã¯ã−m ãªãã·ã§ã³ã
æå®ãããªãã£ãå ´åãããã©ã«ãã®ã¨ãã¥ã¬ã¼ã·ã§ã³ã決å®ããã®ã«
使ç¨ããã¾ãã
ã¨ãã¥ã¬ã¼ã·ã§ã³ã¯ããªã³ã«ã®åä½ã®æ§ããªé¢ãç¹ã«ããã©ã«ãã®
ãªã³ã«ã¹ã¯ãªããã«å½±é¿ãä¸ãã¾ãã
å©ç¨å¯è½ãªã¨ãã¥ã¬ã¼ã·ã§ã³ã®ä¸è¦§ã¯ã−−verbose ããã㯠−V
ãªãã·ã§ã³ãæå®ãããã¨ã§è¡¨ç¤ºã§ãã¾ãã −m
ãªãã·ã§ã³ã使ç¨ãããã"LDEMULATION" ç°å¢å¤æ°ã
å®ç¾©ããã¦ããªãã£ãå ´åãããã©ã«ãã®ã¨ãã¥ã¬ã¼ã·ã§ã³ã¯ããªã³ã«ã
ã©ã®ããã«æ§æããããã«ä¾åãã¾ãã

     é常ããªã³ã«ã¯ããã©ã«ãã§ã·ã³ãã«ãããã³ã°ã«ãã¾ãã
ãããã"COLLECT_NO_DEMANGLE" ç°å¢å¤æ°ãè¨å®ãããå ´åã¯ã
ããã©ã«ãã§ã·ã³ãã«ãããã³ã°ã«ãã¾ããã ãã®ç°å¢å¤æ°ã¯ãgcc
ã®ãªã³ã«ã©ããããã°ã©ã ã§ãåæ§ã«ä½¿ç¨ããã¦ãã¾ãã
ããã©ã«ãã¯ã−−demangle 㨠−−no−demangle ãªãã·ã§ã³ã§
ä¸æ¸ããããã¨ãã§ãã¾ãã

ar(1), nm(1), objcopy(1), objdump(1), readelf(1) ãã㦠Info
ã® binutils 㨠ld é ã

Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000,
2001, 2002, 2003, 2004 Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation
License, Version 1.1 or any later version published by the
Free Software Foundation; with no Invariant Sections, with
no Front‐Cover Texts, and with no Back‐Cover Texts.  A copy
of the license is included in the section entitled "GNU Free
Documentation License".

ãã®æ¥æ¬èªè¨³ã®ä½æã«ããããSRA ã®ç¢å¹æ° (yabuki@sra.co.jp)
ã®è¨³ã åèã«ããã¦ããã ãã¾ããã