ToDo:
shinh@cf-amd64-linux:~> cat hoge.c #include <stdio.h> void hoge() { puts("hoge"); } shinh@cf-amd64-linux:~> gcc -shared -o hoge.so hoge.c /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.1/../../../../x86_64-suse-linux/bin/ld: /tmp/ccaYZHDk.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC /tmp/ccaYZHDk.o: could not read symbols: Bad value collect2: ld returned 1 exit status
¤½¤¦¤¤¤¦¤â¤ó¤Ê¤ó¤«¡Ä
(00:47)
http://shinh.skr.jp/m/?date=200503
¤¢¤¿¤ê¤¬É½¼¨¤Ç¤¤ó¤¯¤Ê¤Ã¤Æ¤¿¤Î¤Ç¥Ñ¥Ã¥Á¡£
defaultio.rb ¤Î
diary = eval( "TDiary::WikiDiary::new( headers['Date'], headers['Title'], body, Time::at( headers['Last-Modified'].to_i ) )" ) #diary = eval( "#{style( style_name )}::new( headers['Date'], headers['Title'], body, Time::at( headers['Last-Modified'].to_i ) )" )
¤è¡¼¤ï¤«¤é¤ó¤¬Æ°¤¯¡£
(01:28)
x86_64 ¤¬ PIC ¤À¤é¤±¤Ë¤Ê¤ë¤Î¤Ï¤ï¤«¤ë¤±¤É¡¢ OSX ¤â¤«¡¼¡Ä
http://d.hatena.ne.jp/w_o/20060913#p3
(01:30)
> ¤³¤³¤é¤Ø¤ó
¤µ¤Æ¤Ê¤ó¤«2¤Ä¤Ë¤ï¤±¤¿Íýͳ¤È¤¤¤¦¤Î¤Ï º£¤Ï¤â¤¦Àµ³Î¤Ë»×¤¤½Ð¤»¤Ê¤¤¤±¤Éº£¸½ºß¤ÎÍýͳ¤È¤·¤Æ¤Ï
¤Þ¤¡¤ß¤Ã¤Ä¤á°Ê³°¤Ï¤É¤¦¤Ç¤â¤¤¤¤¤È¤·¤Æ¡£ ¤É¤¦¤Ç¤â¤¤¤¤ËͤÎÆü¾ï¤È¤«¸«¤¿¤¤Æüì¤Ê¿Í¤Ï ¤³¤Ã¤Á¸«¤Æ¤â¤¤¤¤¤è ¤Ç¤â´ðËÜŪ¤Ëµ»½ÑŪ¤ËÌÌÇò¤¤¤³¤È¤¢¤Ã¤¿¤é ¤Ï¤Æ¤Ê¤ÎÊý¤Ë½ñ¤¯¤èŪ¤Ê¡£
¤É¤¦¤Ç¤â¤¤¤¤¤±¤É¤Ï¤Æ¤Ê¥¢¥«¥¦¥ó¥ÈÆó¤ÄÁàºî¤¹¤ë¤Î¤Ï ¤È¤Æ¤â¤á¤ó¤É¤¯¤µ¤½¤¦¡£
¤Þ¤¡¤³¤¦¤¤¤¦¥á¥â¤ò¥Ý¥ó¥Ý¥óÃÖ¤±¤ë¤Î¤ÏÊØÍø
(04:13)
500½Ð¤ÆÃƤ«¤ì¤ë¤ó¤À¤è¤Ê¡£
500½Ð¤¿¾ì¹ç¤ÏºÆÁ÷¤¹¤ë¤è¤¦¤Ë ¥á¡¼¥ë¥Õ¥£¥ë¥¿¤ÎÊý¤Ç¤ä¤Ã¤Æ¤ª¤¯¤«¤Ê¤¡¡Ä
(04:14)
ËÜÅö¤Ë ¤¢¤¿¤é¤·¤¤¤Î¤¬ ¤¢¤ë
http://packages.debian.org/unstable/libdevel/libestraier-dev
(04:18)
Ëͤϥ¤¥ó¥¹¥È¥é¥¯¥·¥ç¥ó¥»¥Ã¥È¤È¤«¸«¤Æ¤Æ¤â²¿¤â¤ï¤«¤é¤ó¡£
shinh@cf-amd64-linux:~> cat hoge.c int main() {
puts("hoge"); puts("hoge");
}
°Ê²¼Î¬¡£
¤Ê¤ó¤ÀÉáÄ̤¸¤ã¤ó¡£¤Ä¡¼¤³¤È¤Ï¥³¡¼¥É¤Î¥Ð¥°¤À¡£ ¥ª¥±¥ª¥±¡£
jmpq *12345678(%rip)
¤ß¤¿¤¤¤ÊÌ¿Îá¤Ï¡¢ 12345678 ¤Ïñ¤Ê¤ë 32bit ¤ÎʪÂΤǡ¢ ¼Â¹ÔÁ°¤Ë¥ê¥í¥±¡¼¥·¥ç¥ó¤µ¤ì¤ë¤ó¤À¤±¤É¡¢ ¤½¤ÎÀè¤Ë 64bit ¤Î¥¢¥É¥ì¥¹¤¬¤¨¡¼¤È
0x500820 <_GLOBAL_OFFSET_TABLE_+16>: 0x955610e0 0x0000002a
¤Þ¤¡¤³¤ó¤Ê´¶¤¸¤ÇÃÖ¤¤¤Æ¤¢¤ë¤Î¤Ç¡¢ 0x0000002a955610e0 ¤ËÈô¤Ö¡Ä ¤Ã¤ÆÉáÄ̤˴ÖÀÜ¥¸¥ã¥ó¥×¤·¤Æ¤ë¤À¤±¤¸¤ã¤ó¡£
(04:50)
int main(int argc, char *argv[], char *envp[]) { int i; char buf[4096]; void *fp = fopen("/proc/self/maps", "r"); while (fgets(buf, 4095, fp)) printf("%s", buf); for (i = 0; i < 10000; i++) { printf("%d %p %p\n", i, argv[i], &argv[i]); } }
¤Ê¤ó¤«Ëè²óÁ´Á³°ã¤¦¤Ê¡£ ¤Þ¤¿¤Ê¤ó¤«¥»¥¥å¥ê¥Æ¥£´Ø·¸¤Ç¤¢¤ê¤¬¤¿¤¤^H^H^H^H^H;·×¤Ê¤³¤È¤µ¤ì¤Æ¤ë¤ó¤À¤í¤¦¤«
ÉáÄ̤ȵդÎɽ¸½¤Î¤·¤«¤¿¤ò¤·¤Æ¤ß¤¿
¤Þ¤¡¤ï¤«¤ë¤³¤È¤Ï¤¨¤é¤¤¹¤¤¤È¤¤¤¦¤³¤È¤À¤Ê¤¡¡£
(05:10)
(15:41)
¶Ã¤¯¤Û¤É̵¤¯¤Ê¤Ã¤Æ¤¿¡£
15Ëü¤È¤«¤½¤Î¤¯¤é¤¤¡£
Àè·î¤ÎµëͿ̵¤¤¤³¤È¹Í¤¨¤ë¤È¤Þ¤¡¤·¤Ð¤é¤¯¤Ï¤â¤Ä¤¬¡£
TODO: ÀáÌó
(18:07)
´Ø¿ôÆâ¤Ç¡¢¥ë¡¼¥×¤Î¤¿¤á¤Ë let rec ¤Ê´Ø¿ô¤ò ¤â¤¦°ì¸Ä½ñ¤¯¤³¤È¤¬¤è¤¯¤¢¤ë¤±¤É¡¢ ¤³¤ì¤Ë¤Ä¤±¤ë̾Á°¤ÇǺ¤à¡£ ¸µ¤Î´Ø¿ô¤ÈƱ¤¸Ì¾Á°¤¬°ìÈÖ¼«Á³¤À¤Ã¤¿¤ê¤·¤Æ¤Í¡£
k.inaba¤µ¤ó¤¬ Python ¤Ç¤ä¤Ã¤Æ¤¿ _ ¤Ï¤¤¤¤¤Ê¤È»×¤Ã¤¿¤±¤É OCaml ¤Ë¤Ï¤ª¤³¤é¤ì¤¿¡£
¤à¡¼¡©
http://ocaml.jp/archive/document/intro1.html
iter ¤Í¤§¡Ä
¤à¡¼¡£
__ ¤Ï¤¤¤¤¤é¤·¤¤¡£ ¤à¤·¤í¤Ê¤ó¤Ç _ ¤¬¤¢¤«¤ó¤Í¤ó¡£
# let _ x = x;; Syntax error # let _ = 1;; - : int = 1
http://www.sato.kuis.kyoto-u.ac.jp/~igarashi/class/isle4-05w/mltext/ocaml003.html#toc6
¤³¤³¤ÎÊÑ¿ô¤Î̾Á°¤Ë¤À¤á¤È½ñ¤¤¤Æ¤¢¤ë¤Ê¤¡¡£
_' ¤È¤«¡Ä
(18:45)
2000±ßÃ¥´Ô¼ºÇÔ¡Ä ¤Ä¤¤¤Ç¤Ë5000±ßÎÀÈñ̵Â̤Ëʧ¤Ã¤¿¤¯¤µ¤¤¡£
¤Ê¤ó¤Ç¤ä¤Í¤ó¡£
(21:25)
OCaml ¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤Ã¤Æ´Ø¿ô¤È¤·¤Æ°·¤¨¤Ê¤¤¤Î¤«¤·¤é¤ó¡£
# type t = A of int | B of int;; type t = A of int | B of int # let x = A;; The constructor A expects 1 argument(s), but is here applied to 0 argument(s)
(22:17)
# type t = A of int | B of int;; type t = A of int | B of int # a = A 1;; Unbound value a # let a = A 1;; val a : t = A 1 # let b = A 1;; val b : t = A 1 # a == b;; - : bool = false
¤½¤¦¤Ê¤Î¤Í¡Ä ¤ó¡¼¤È¡£
(22:55)
http://www.i.kyushu-u.ac.jp/~bannai/ocaml-intro/traps.html#equality
¤À¤Ã¤¿¡£ ¤Ä¡¼¤«Ëº¤ì¤¹¤®¡£
(22:56)
Á° | 2006ǯ 9·î |
¼¡ | ||||
Æü | ·î | ²Ð | ¿å | ÌÚ | ¶â | ÅÚ |
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Á´¤Æ¥ê¥ó¥¯¥Õ¥ê¡¼¤Ç¤¹¡£ ¥³¡¼¥ÉÊҤϼ«Í³¤Ë»ÈÍѤ·¤Æ¤¤¤¿¤À¤¤¤Æ¹½¤¤¤Þ¤»¤ó¡£ ¤½¤Î¾¤Î¤â¤Î¤ÏGPL°·¤¤¤Ç¤¢¤ì¤Ð¤¢¤é¤æ¤ë»ÈÍѤ˴ؤ·¤Æʸ¶ç¤Ï¸À¤¤¤Þ¤»¤ó¡£ ¤Ê¤Ë¤«¤¢¤ì¤Ð²¼µ¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ø¡£