nm






nm − ãªãã¸ã§ã¯ããã¡ã¤ã«ããã·ã³ãã«ããªã¹ããã

nm [−a−−debug−syms] [−g−−extern−only]
   [−B] [−C−−demangle[=style]] [−D−−dynamic]
   [−S−−print−size] [−s−−print−armap]
   [−A−o−−print−file−name]
   [−n−v−−numeric−sort] [−p−−no−sort]
   [−r−−reverse−sort] [−−size−sort] [−u−−undefined−only]
   [−t radix−−radix=radix] [−P−−portability]
   [−−target=bfdname] [−fformat−−format=format]
   [−−defined−only] [−l−−line−numbers] [−−no−demangle]
   [−V−−version] [−X 32_64] [−−help]  [objfile...]

GNU nm ã¯ãªãã¸ã§ã¯ããã¡ã¤ã« objfile...  ããã·ã³ãã«ããªã¹ããã¾ãã
å¼æ°ã§ãªãã¸ã§ã¯ããã¡ã¤ã«ãä¸ããããªãã¨ã nm 㯠a.out
ã対象ã¨ãã¾ãã

     åã·ã³ãã«ã«å¯¾ããnm ã¯æ¬¡ã®ãã®ã表示ãã¾ã:

•   ã·ã³ãã«ã®å¤ãããªãã·ã§ã³ã§é¸æãããåºæ° (å¾è¿°)
    ã¾ãã¯ããã©ã«ãã® 16 é²æ°ã§è¡¨ç¤ºãã¾ãã

•   ã·ã³ãã«ã®åã å°ãªãã¨ã次ã®åã使ç¨ããã¾ãã
    ä»ã®åã«ã¤ãã¦ã¯ãªãã¸ã§ã¯ããã¡ã¤ã«ãã©ã¼ãããã«ä¾åãã¾ãã å°æå‐
    ã®å ´åã·ã³ãã«ã¯ãã¼ã«ã«ã§ããã大æåã®å ´åã·ã³ãã«ã¯ã°ãã¼ãã«
    (å¤é¨çã§ã)ã

    "A" ã·ã³ãã«ã®å¤ã¯çµ¶å¯¾çã§ããããããªããªã³ã¯ã«ãã£ã¦å¤æ´ããã¾ããã

    "B" ã·ã³ãã«ã¯æªåæåãã¼ã¿ã»ã¯ã·ã§ã³ (BSS ã®ãã¨) ã«ããã¾ãã

    "C" ã·ã³ãã«ã¯ã³ã¢ã³ã§ãã ã³ã¢ã³ã·ã³ãã«ã¯æªåæåãã¼ã¿ã§ãã
        ãªã³ã¯æã«ã¯ãè¤æ°ã®ã³ã¢ã³ã·ã³ãã«ãåä¸ã®ååã¨ãã¦è¦ãå¾ã¾ãã
        ã·ã³ãã«ãã©ããã§å®ç¾©ããã¦ããå ´åã
        ã³ã¢ã³ã·ã³ãã«ã¯æªå®ç¾©ã®åç§ã¨ãã¦æ±ããã¾ãã

    "D" ã·ã³ãã«ã¯åæåæ¸ãã¼ã¿ã»ã¯ã·ã§ã³ã«ããã¾ãã

    "G" ã·ã³ãã«ã¯ãå°ãããªãã¸ã§ã¯ãç¨ã®ãåæåæ¸ãã¼ã¿ã»ã¯ã·ã§ã³ã«ããã¾ãã
        ãªãã¸ã§ã¯ããã©ã¼ãããã«ãã£ã¦ã¯ã
        å°ãããã¼ã¿ãªãã¸ã§ã¯ãã¸ã®ããå¹çã®è¯ã
        ã¢ã¯ã»ã¹ãæä¾ãã¦ãããã®ãããã¾ãã å°ãããªãã¸ã§ã¯ãã¨ã¯ã
        ä¾ãã°ã大ããªã°ãã¼ãã«éåã«å¯¾ãããã°ãã¼ãã« int
        å¤æ°ã®ãã¨ãæãã¾ãã

    "I" ã·ã³ãã«ã¯ãä»ã®ã·ã³ãã«ã«å¯¾ããéæ¥åç§ã§ãã ããã¯ãa.out
        ãªãã¸ã§ã¯ããã¡ã¤ã«ãã©ã¼ãããã«å¯¾ãã GNU æ¡å¼µã§ããã
        ã»ã¨ãã©ä½¿ããã¾ããã

    "N" ã·ã³ãã«ã¯ãããã°ã·ã³ãã«ã§ãã

    "R" ã·ã³ãã«ã¯èªã¿åãå°ç¨ã»ã¯ã·ã§ã³ã«ããã¾ãã











                             ‐2‐


    "S" ã·ã³ãã«ã¯ãå°ãããªãã¸ã§ã¯ãç¨ã®ãæªåæåãã¼ã¿ã»ã¯ã·ã§ã³ã«ããã¾ãã

    "T" ã·ã³ãã«ã¯ãããã¹ã (ã³ã¼ã) ã»ã¯ã·ã§ã³ã«ããã¾ãã

    "U" ã·ã³ãã«ã¯æªå®ç¾©ã§ãã

    "V" ã·ã³ãã«ã¯å¼±ããªãã¸ã§ã¯ãã§ãã
        å¼±ãå®ç¾©ãããã·ã³ãã«ãé常å®ç¾©ãããã·ã³ãã«ã¨ãªã³ã¯ãããã¨ãã
        ã¨ã©ã¼ç¡ãã§é常å®ç¾©ãããã·ã³ãã«ã使ç¨ããã¾ãã
        å¼±ãæªå®ç¾©ãªã·ã³ãã«ããªã³ã¯ãããã®ã·ã³ãã«ãæªå®ç¾©ãªã¨ãã
        å¼±ãã·ã³ãã«ã®å¤ã¯ã¨ã©ã¼ç¡ãã« 0 ã«ãªãã¾ãã

    "W" ã·ã³ãã«ã¯å¼±ããªãã¸ã§ã¯ãã§ããã
        å¼±ããªãã¸ã§ã¯ãã§ããã¨ã¯ç¹ã«æå®ããã¦ãã¾ããã§ããã
        å¼±ãå®ç¾©ãããã·ã³ãã«ãé常å®ç¾©ãããã·ã³ãã«ã¨ãªã³ã¯ãããã¨ãã
        ã¨ã©ã¼ç¡ãã§é常å®ç¾©ãããã·ã³ãã«ã使ç¨ããã¾ãã
        å¼±ãæªå®ç¾©ãªã·ã³ãã«ããªã³ã¯ãããã®ã·ã³ãã«ãæªå®ç¾©ãªã¨ãã
        å¼±ãã·ã³ãã«ã®å¤ã¯ã¨ã©ã¼ç¡ãã« 0 ã«ãªãã¾ãã

    "−" ã·ã³ãã«ã¯ãa.out ãªãã¸ã§ã¯ããã¡ã¤ã«ã® stabs
        ã·ã³ãã«ã§ãã ãã®å ´åã次ã«è¡¨ç¤ºãããå¤ã¯ã stabs
        ã®ä»ã®ãã£ã¼ã«ããstabs ã® desc ãã£ã¼ã«ããstab ã¿ã¤ãã§ãã
        stabs ã·ã³ãã«ã¯ãããã°æå ±ãä¿æããããã«ä½¿ç¨ããã¾ãã

    "?" ã·ã³ãã«ã®åã¯æªç¥ã§ããããªãã¸ã§ã¯ããã¡ã¤ã«ãã©ã¼ãããåºæã§ãã

•   ã·ã³ãã«åã

以ä¸ã§é¸æè¢ã¨ãã¦ç¤ºããããªãã·ã§ã³ã®é·å½¢å¼ã¨çå½¢å¼ã¯ç価ã§ãã

−A

−o

−−print−file−name
    å¥åãã¡ã¤ã«ã«å«ã¾ãããã¹ã¦ã®ã·ã³ãã«ã®åã«ä¸åº¦ã ãå¥åãã¡ã¤ã«ã
    表示ããã®ã§ã¯ãªããåã·ã³ãã«ã®åã« ãããå«ã¾ããå¥åãã¡ã¤ã«å
    (ã¾ãã¯ã¢ã¼ã«ã¤ãã¡ã³ã) ã表示ãã¾ãã

−a

−−debug−syms
    ãããã¬å°ç¨ã·ã³ãã«ã§ãã£ã¦ããå¨ã·ã³ãã«ã表示ãã¾ãã
    é常ããããã°å°ç¨ã·ã³ãã«ã¯ãªã¹ãããã¾ããã

−B  −−format=bsd ã¨åãã§ã (MIPS ã® nm ã¨ã®äºææ§ã®ããã«ããã¾ã)ã

−C

−−demangle[=style]
    ä½ã¬ãã«ã®ã·ã³ãã«åãã¦ã¼ã¶ã¬ãã«ã®ååã«ãã³ã¼ã (demangle)
    ãã¾ãã ããã«ã·ã¹ãã ãä»å ããåé ã®ã¢ã³ãã¹ã³ã¢ããã¹ã¦
    åãé¤ãã®ã§ãããã«ãã£ã¦ C++ ã®é¢æ°åããããããããªãã¾ãã
    ã³ã³ãã¤ã©ãã¨ã«ããã³ã°ã«æ¹æ³ãç°ãªãã¾ãã









                             ‐3‐


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

−−no−demangle
    ä½ã¬ãã«ã®ã·ã³ãã«åãããã³ã°ã«ãã¾ããã ãããããã©ã«ãã§ãã

−D

−−dynamic
    é常ã®ã·ã³ãã«ã§ã¯ãªããã¤ãããã¯ã·ã³ãã«ã表示ãã¾ãã
    ããã¯ããã種ã®å±æã©ã¤ãã©ãªãªã©ã®
    ãã¤ãããã¯ãªãã¸ã§ã¯ãã«å¯¾ãã¦ã®ã¿æå³ãæã¡ã¾ãã

−f format

−−format=format
    åºåå½¢å¼ã¨ã㦠format ã使ãã¾ãã "bsd", "sysv", "posix"
    ãæå®ã§ãã¾ãã ããã©ã«ã㯠"bsd" ã§ãã format ã® 1 æå‐
    ç®ã ããéè¦ã§ã大æåã§ãå°æåã§ã æ§ãã¾ããã

−g

−−extern−only
    å¤é¨ã·ã³ãã«ã ãã表示ãã¾ãã

−l

−−line−numbers
    åã·ã³ãã«ã«ã¤ãã¦ããããã°æå ±ã使ã£ã¦ãã¡ã¤ã«åã¨è¡çªå·ãè¦ã¤ãããã
    試ã¿ã¾ãã å®ç¾©ããã¦ããã·ã³ãã«ã«ã¤ãã¦ã¯ãã·ã³ãã«ã®ã¢ãã¬ã¹ã«
    対å¿ããè¡çªå·ãæãã¾ãã
    æªå®ç¾©ã®ã·ã³ãã«ã«ã¤ãã¦ã¯ããã®ã·ã³ãã«ã
    åç§ãã¦ããåéç½®ã¨ã³ããªã®è¡çªå·ãæãã¾ãã è¡çªå·æå ±ã
    è¦ã¤ãããããªããä»ã®ã·ã³ãã«æå ±ã®å¾ã«è¡¨ç¤ºãã¾ãã

−n

−v

−−numeric−sort
    ã·ã³ãã«ãååã®ã¢ã«ãã¡ãããé ã§ã¯ãªãã
    ã·ã³ãã«ã®ã¢ãã¬ã¹ã§æ°å¤é ã«ãªãã¹ã¾ãã

−p

−−no−sort
    ã·ã³ãã«ã®ä¸¦ã¹æ¿ããä¸åãã¾ããã åã«åºã¦æ¥ãé ã«è¡¨ç¤ºãã¾ãã

−P

−−portability
    ããã©ã«ãã®å½¢å¼ã®ãããã« POSIX.2 æ¨æºã®åºåå½¢å¼ã使ãã¾ãã −f
    posix ã¨ç価ã§ãã










                             ‐4‐


−S

−−print−size
    "bsd" åºåå½¢å¼ã«ããã¦ã å®ç¾©ãããã·ã³ãã«ã® (å¤ã§ãªã)
    大ããã表示ãã¾ãã

−s

−−print−armap
    ã¢ã¼ã«ã¤ãã®ã¡ã³ãã®ã·ã³ãã«ããªã¹ãããéã«ãã¤ã³ããã¯ã¹ã å«ãã¾ãã
    ã¤ã³ããã¯ã¹ (ã¢ã¼ã«ã¤ãä¸ã« ar ã ranlib ã«ãã£ã¦ç½®ããã¾ã)
    ã¨ã¯ã©ã®ã¢ã¸ã¥ã¼ã«ã«ã©ã®ååã®å®ç¾©ã
    å«ã¾ãã¦ãããã®å¯¾å¿ã®äºã§ãã

−r

−−reverse−sort
    (æ°å¤ã¾ãã¯ã¢ã«ãã¡ãããã«ãã) 並ã¹æ¿ããéé ã«ãã¾ãã
    æå¾ãæåã«æ¥ãããã«ãã¾ãã

−−size−sort
    ã·ã³ãã«ããµã¤ãºã§ä¸¦ã¹æ¿ãã¾ãã
    ãµã¤ãºã¯ã·ã³ãã«ã®å¤ã¨ãã®æ¬¡ã«é«ä½ã®
    å¤ãæã¤ã·ã³ãã«ã®å¤ã®éã®å·®åããè¨ç®ããã¾ãã "bsd"
    åºåå½¢å¼ã使ç¨ããå ´åã¯ã ã·ã³ãã«ã® (å¤ã§ãªã)
    ãµã¤ãºã表示ããã¾ãã å¤ã¨ãµã¤ãºã®ä¸¡æ¹ã表示ãããããã«ã¯ã−S
    ã 使ç¨ããªããã°ãªãã¾ããã

−t radix

−−radix=radix
    ã·ã³ãã«ã®å¤ã表示ããéã« radix ãåºæ°ã¨ãã¦ä½¿ãã¾ãã
    æå®ã¯ã10 é²ã®å ´å㯠dã8 é²ã®å ´å㯠oã16 é²ã®å ´å㯠x ã®
    ããããã§ãã

−−target=bfdname
    ã·ã¹ãã ã®ããã©ã«ãã®å½¢å¼ã§ã¯ãªããªãã¸ã§ã¯ãã³ã¼ãå½¢å¼ãæå®ãã¾ãã

−u

−−undefined−only
    æªå®ç¾©ã·ã³ãã« (åãªãã¸ã§ã¯ããã¡ã¤ã«ã®å¤é¨ã·ã³ãã«)
    ã®ã¿ã表示ãã¾ãã

−−defined−only
    åãªãã¸ã§ã¯ããã¡ã¤ã«ã«å¯¾ããå®ç¾©ããã¦ããã·ã³ãã«ã®ã¿ã表示ãã¾ãã

−V

−−version
    nm ã®ãã¼ã¸ã§ã³çªå·ã表示ãã¦çµäºãã¾ãã

−X  AIX ã® nm ã¨ã®äºææ§ã®ããã«ãæ¬ãªãã·ã§ã³ã¯ç¡è¦ããã¾ãã
    ãã©ã¡ã¼ã¿ã²ã¨ã¤ãåãããã㯠32_64 ã§ãããã¨ãå¿è¦ã§ãã AIX nm









                             ‐5‐


    ã®ããã©ã«ãã¢ã¼ã㯠−X 32 ã«å¯¾å¿ãã¾ããã ãã㯠GNU nm
    ã¯ãµãã¼ããã¦ãã¾ããã

−−help
    nm ã®ãªãã·ã§ã³ã®ãµããªã表示ãã¦çµäºãã¾ãã

ar(1), objdump(1), ranlib(1), Info ã® binutils ã®é ã

Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000,
2001, 2002, 2003 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’’.

éé¦ å¯é«(hnokubi@yyy.or.jp): FreeBSD ç¨ã«ç¿»è¨³