cygwin目次このページは
cygwin についてのメモ。 cygwin でwindows ネイティブなプログラムを作る
windows ネイティブなプログラムの作り方cygwin についてのメモ。gcc に -mno-cygwin をつけると良い。 $ gcc -mno-cygwin target-program.c windows ネイティブなプログラムのobjdump
cygwin1.dll の代わりにmsvcrt.dll がリンクされている。 $ objdump -p a.exe
a.exe: file format pei-i386
Characteristics 0x307
relocations stripped
executable
line numbers stripped
32 bit words
debugging information removed
Time/Date Sun Oct 1 17:26:25 2006
ImageBase 00400000
SectionAlignment 00001000
FileAlignment 00000200
MajorOSystemVersion 4
MinorOSystemVersion 0
MajorImageVersion 1
MinorImageVersion 0
MajorSubsystemVersion 4
MinorSubsystemVersion 0
Win32Version 00000000
SizeOfImage 00006000
SizeOfHeaders 00000400
CheckSum 0000b89d
Subsystem 00000003 (Windows CUI)
DllCharacteristics 00000000
SizeOfStackReserve 00200000
SizeOfStackCommit 00001000
SizeOfHeapReserve 00100000
SizeOfHeapCommit 00001000
LoaderFlags 00000000
NumberOfRvaAndSizes 00000010
The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 00005000 00000260 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved
There is an import table in .idata at 0x405000
The Import Tables (interpreted .idata section contents)
vma: Hint Time Forward DLL First
Table Stamp Chain Name Thunk
00005000 00005040 00000000 00000000 0000523c 0000509c
DLL Name: msvcrt.dll
vma: Hint/Ord Member-Name Bound-To
50f4 39 __getmainargs
5104 60 __p__environ
5114 62 __p__fmode
5124 80 __set_app_type
5138 121 _cexit
5144 233 _iob
514c 350 _onexit
5158 388 _setmode
5164 540 atexit
5170 557 fclose
517c 568 fopen
5184 569 fprintf
5190 570 fputc
5198 626 malloc
51a4 634 memset
51b0 639 printf
51bc 656 signal
00005014 0000508c 00000000 00000000 00005250 000050e8
DLL Name: KERNEL32.dll
vma: Hint/Ord Member-Name Bound-To
51c8 155 ExitProcess
51d8 735 SetUnhandledExceptionFilter
00005028 00000000 00000000 00000000 00000000 00000000
cygwin に依存したプログラムgcc に-mno-cygwin をつけないでコンパイルしたあと、出来上がったexe ファイルをエクスプローラなどから実行すると、以下のようなメッセージが出て起動できない。 cygwin1.dll が見つからなかったため、このアプリケーションを開始できませんでした。アプリケーションをインストールし直すとこの問題は解決される場合があります。 cygwin に依存したプログラムのobjdumpcygwin1.dll がリンクされている。 $ objdump -p a.exe
a.exe: file format pei-i386
Characteristics 0x307
relocations stripped
executable
line numbers stripped
32 bit words
debugging information removed
Time/Date Sun Oct 1 17:31:33 2006
ImageBase 00400000
SectionAlignment 00001000
FileAlignment 00000200
MajorOSystemVersion 4
MinorOSystemVersion 0
MajorImageVersion 1
MinorImageVersion 0
MajorSubsystemVersion 4
MinorSubsystemVersion 0
Win32Version 00000000
SizeOfImage 00005000
SizeOfHeaders 00000400
CheckSum 00010b89
Subsystem 00000003 (Windows CUI)
DllCharacteristics 00000000
SizeOfStackReserve 00200000
SizeOfStackCommit 00001000
SizeOfHeapReserve 00100000
SizeOfHeapCommit 00001000
LoaderFlags 00000000
NumberOfRvaAndSizes 00000010
The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 00004000 00000230 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved
There is an import table in .idata at 0x404000
The Import Tables (interpreted .idata section contents)
vma: Hint Time Forward DLL First
Table Stamp Chain Name Thunk
00004000 00004040 00000000 00000000 0000420c 00004094
DLL Name: cygwin1.dll
vma: Hint/Ord Member-Name Bound-To
40e4 45 __getreent
40f4 47 __main
4100 223 _fopen64
410c 318 _impure_ptr
411c 689 calloc
4128 743 cygwin_internal
413c 763 dll_crt0__FP11per_process
4158 818 fclose
4164 857 fprintf
4170 858 fputc
4178 861 free
4180 1071 malloc
418c 1091 memset
4198 1146 printf
41a4 1245 realloc
00004014 00004088 00000000 00000000 00004220 000040dc
DLL Name: KERNEL32.dll
vma: Hint/Ord Member-Name Bound-To
41bc 335 GetModuleHandleA
00004028 00000000 00000000 00000000 00000000 00000000
参考参考:http://www.interq.or.jp/japan/s-imai/tcltk/msys_mingw.html tipsstartxwin.batcygwin でx をインストールでき、 起動は通常コマンドラインから $ startx
と入力するが、現在(20050731 現在)のcygwin では
startxwin.bat が C:\cygwin\usr\X11R6\bin にある。 rxvt
cygwin 日本語環境
cygwin でssh server
設定してみたがうまくいかない。 参考文献・参考ウェブページ
履歴
|
||
|
|
||
|
ご意見、ご感想、誤字、間違い等、お気づきの点がありましたら KGussan@Gmail.com まで連絡ください。
このウェブページの注意・免責事項
Copyright (C) 2004-2012 KGussan.
[トップページ]
[PR:元国税局勤務の起業家向け、遺産相続の相談なら植村洋税理士事務所:一時間無料税理士相談。お気軽に。] |
||