tcc 原始碼分析技巧

  • source code
http://download.savannah.gnu.org/releases/tinycc/
wget http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.26.tar.bz2
tar xvf tcc-0.9.26.tar.bz2
cd tcc-0.9.26
./configure
make CFLAGS='-g -O0'
#include <stdio.h>

int main(int argc, char* argv[])
{
    printf("Hello world\n");
    return 0;
}
  • gdb 分析編譯過程
cgdb --args ./tcc -B. hello.c -o hello

书籍推荐