day3-ld

ldの役割
 ー シンボルへのアドレス割付作業
 ー ファイルヘッダーやセクションヘッダーの作成
   ファイルヘッダーってのは elfヘッダーとはちがうのか?
   バイナリを作成する際には elfとは限らないってことか

リンカースクリプト
 ディフォルトのエミュレーションモード(ELF)用のスクリプトファイルは
 ldコマンドの実行ファイル内に直接埋めこまれている、
  ld --verboseにて確認できるらしい
 a.out 形式(その昔のバイナリーフォーマット)
 のエミュレーション用のファイルは/usr/lib/ldscripts ディレクト
 内に用意されているらしいが、RedHatにはそんなもんはねぇよw

 ちなみにUbuntuにはあったぞ

 RedHat系はソースからいれなおせってことかしら。

 以下、Ubuntuの場合、

[hirasawa@ubunt1004-32-2 ldscripts]$ pwd
/usr/lib/ldscripts
[hirasawa@ubunt1004-32-2 ldscripts]$ ls -ltr
合計 1012
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega7.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega7.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega7.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega7.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega7.x
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega6.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega6.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega6.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega6.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega6.x
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega5.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega5.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega5.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega5.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega5.x
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega4.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega4.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega4.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega4.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega4.x
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega3.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega3.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega3.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega3.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega3.x
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega2.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega2.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega2.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega2.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega2.x
-rw-r--r-- 1 root root 5183 2009-11-27 21:29 avrxmega1.xu
-rw-r--r-- 1 root root 4974 2009-11-27 21:29 avrxmega1.xr
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega1.xn
-rw-r--r-- 1 root root 6099 2009-11-27 21:29 avrxmega1.xbn
-rw-r--r-- 1 root root 6081 2009-11-27 21:29 avrxmega1.x
-rw-r--r-- 1 root root 5181 2009-11-27 21:29 avr6.xu
-rw-r--r-- 1 root root 4972 2009-11-27 21:29 avr6.xr
-rw-r--r-- 1 root root 6079 2009-11-27 21:29 avr6.xn
-rw-r--r-- 1 root root 6097 2009-11-27 21:29 avr6.xbn
-rw-r--r-- 1 root root 6079 2009-11-27 21:29 avr6.x
-rw-r--r-- 1 root root 5181 2009-11-27 21:29 avr51.xu
-rw-r--r-- 1 root root 4972 2009-11-27 21:29 avr51.xr
-rw-r--r-- 1 root root 6079 2009-11-27 21:29 avr51.xn
-rw-r--r-- 1 root root 6097 2009-11-27 21:29 avr51.xbn
-rw-r--r-- 1 root root 6079 2009-11-27 21:29 avr51.x
-rw-r--r-- 1 root root 5180 2009-11-27 21:29 avr5.xu
-rw-r--r-- 1 root root 4971 2009-11-27 21:29 avr5.xr
-rw-r--r-- 1 root root 6078 2009-11-27 21:29 avr5.xn
-rw-r--r-- 1 root root 6096 2009-11-27 21:29 avr5.xbn
-rw-r--r-- 1 root root 6078 2009-11-27 21:29 avr5.x
-rw-r--r-- 1 root root 5178 2009-11-27 21:29 avr4.xu
-rw-r--r-- 1 root root 4969 2009-11-27 21:29 avr4.xr
-rw-r--r-- 1 root root 6076 2009-11-27 21:29 avr4.xn
-rw-r--r-- 1 root root 6094 2009-11-27 21:29 avr4.xbn
-rw-r--r-- 1 root root 6076 2009-11-27 21:29 avr4.x
-rw-r--r-- 1 root root 5180 2009-11-27 21:29 avr35.xu
-rw-r--r-- 1 root root 4971 2009-11-27 21:29 avr35.xr
-rw-r--r-- 1 root root 6078 2009-11-27 21:29 avr35.xn
-rw-r--r-- 1 root root 6096 2009-11-27 21:29 avr35.xbn
-rw-r--r-- 1 root root 6078 2009-11-27 21:29 avr35.x
-rw-r--r-- 1 root root 5181 2009-11-27 21:29 avr31.xu
-rw-r--r-- 1 root root 4972 2009-11-27 21:29 avr31.xr
-rw-r--r-- 1 root root 6079 2009-11-27 21:29 avr31.xn
-rw-r--r-- 1 root root 6097 2009-11-27 21:29 avr31.xbn
-rw-r--r-- 1 root root 6079 2009-11-27 21:29 avr31.x
-rw-r--r-- 1 root root 5180 2009-11-27 21:29 avr3.xu
-rw-r--r-- 1 root root 4971 2009-11-27 21:29 avr3.xr
-rw-r--r-- 1 root root 6078 2009-11-27 21:29 avr3.xn
-rw-r--r-- 1 root root 6096 2009-11-27 21:29 avr3.xbn
-rw-r--r-- 1 root root 6078 2009-11-27 21:29 avr3.x
-rw-r--r-- 1 root root 5179 2009-11-27 21:29 avr25.xu
-rw-r--r-- 1 root root 4970 2009-11-27 21:29 avr25.xr
-rw-r--r-- 1 root root 6077 2009-11-27 21:29 avr25.xn
-rw-r--r-- 1 root root 6095 2009-11-27 21:29 avr25.xbn
-rw-r--r-- 1 root root 6077 2009-11-27 21:29 avr25.x
-rw-r--r-- 1 root root 5178 2009-11-27 21:29 avr2.xu
-rw-r--r-- 1 root root 4969 2009-11-27 21:29 avr2.xr
-rw-r--r-- 1 root root 6076 2009-11-27 21:29 avr2.xn
-rw-r--r-- 1 root root 6094 2009-11-27 21:29 avr2.xbn
-rw-r--r-- 1 root root 6076 2009-11-27 21:29 avr2.x
-rw-r--r-- 1 root root 5173 2009-11-27 21:29 avr1.xu
-rw-r--r-- 1 root root 4964 2009-11-27 21:29 avr1.xr
-rw-r--r-- 1 root root 6071 2009-11-27 21:29 avr1.xn
-rw-r--r-- 1 root root 6089 2009-11-27 21:29 avr1.xbn
-rw-r--r-- 1 root root 6071 2009-11-27 21:29 avr1.x
-rw-r--r-- 1 root root  688 2011-03-04 12:21 i386linux.xu
-rw-r--r-- 1 root root  648 2011-03-04 12:21 i386linux.xr
-rw-r--r-- 1 root root  887 2011-03-04 12:21 i386linux.xn
-rw-r--r-- 1 root root  893 2011-03-04 12:21 i386linux.xbn
-rw-r--r-- 1 root root  892 2011-03-04 12:21 i386linux.x
-rw-r--r-- 1 root root 7688 2011-03-04 12:21 elf_x86_64.xw
-rw-r--r-- 1 root root 4943 2011-03-04 12:21 elf_x86_64.xu
-rw-r--r-- 1 root root 7227 2011-03-04 12:21 elf_x86_64.xsw
-rw-r--r-- 1 root root 7237 2011-03-04 12:21 elf_x86_64.xsc
-rw-r--r-- 1 root root 7522 2011-03-04 12:21 elf_x86_64.xs
-rw-r--r-- 1 root root 4897 2011-03-04 12:21 elf_x86_64.xr
-rw-r--r-- 1 root root 8000 2011-03-04 12:21 elf_x86_64.xn
-rw-r--r-- 1 root root 7637 2011-03-04 12:21 elf_x86_64.xdw
-rw-r--r-- 1 root root 7647 2011-03-04 12:21 elf_x86_64.xdc
-rw-r--r-- 1 root root 7932 2011-03-04 12:21 elf_x86_64.xd
-rw-r--r-- 1 root root 7698 2011-03-04 12:21 elf_x86_64.xc
-rw-r--r-- 1 root root 7783 2011-03-04 12:21 elf_x86_64.xbn
-rw-r--r-- 1 root root 8000 2011-03-04 12:21 elf_x86_64.x
-rw-r--r-- 1 root root 7528 2011-03-04 12:21 elf_l1om.xw
-rw-r--r-- 1 root root 4967 2011-03-04 12:21 elf_l1om.xu
-rw-r--r-- 1 root root 6979 2011-03-04 12:21 elf_l1om.xsw
-rw-r--r-- 1 root root 6989 2011-03-04 12:21 elf_l1om.xsc
-rw-r--r-- 1 root root 7288 2011-03-04 12:21 elf_l1om.xs
-rw-r--r-- 1 root root 4921 2011-03-04 12:21 elf_l1om.xr
-rw-r--r-- 1 root root 7766 2011-03-04 12:21 elf_l1om.xn
-rw-r--r-- 1 root root 7477 2011-03-04 12:21 elf_l1om.xdw
-rw-r--r-- 1 root root 7487 2011-03-04 12:21 elf_l1om.xdc
-rw-r--r-- 1 root root 7698 2011-03-04 12:21 elf_l1om.xd
-rw-r--r-- 1 root root 7538 2011-03-04 12:21 elf_l1om.xc
-rw-r--r-- 1 root root 7549 2011-03-04 12:21 elf_l1om.xbn
-rw-r--r-- 1 root root 7766 2011-03-04 12:21 elf_l1om.x
-rw-r--r-- 1 root root 7087 2011-03-04 12:21 elf_i386.xw
-rw-r--r-- 1 root root 4650 2011-03-04 12:21 elf_i386.xu
-rw-r--r-- 1 root root 6624 2011-03-04 12:21 elf_i386.xsw
-rw-r--r-- 1 root root 6634 2011-03-04 12:21 elf_i386.xsc
-rw-r--r-- 1 root root 6804 2011-03-04 12:21 elf_i386.xs
-rw-r--r-- 1 root root 4604 2011-03-04 12:21 elf_i386.xr
-rw-r--r-- 1 root root 7284 2011-03-04 12:21 elf_i386.xn
-rw-r--r-- 1 root root 7032 2011-03-04 12:21 elf_i386.xdw
-rw-r--r-- 1 root root 7042 2011-03-04 12:21 elf_i386.xdc
-rw-r--r-- 1 root root 7212 2011-03-04 12:21 elf_i386.xd
-rw-r--r-- 1 root root 7097 2011-03-04 12:21 elf_i386.xc
-rw-r--r-- 1 root root 7067 2011-03-04 12:21 elf_i386.xbn
-rw-r--r-- 1 root root 7284 2011-03-04 12:21 elf_i386.x
[hirasawa@ubunt1004-32-2 ldscripts]$ 

avr系が充実しているのは、おそらくavrdudeとか入れたからだな