タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

gccに関するhirose31のブックマーク (3)

  • いやなブログ: Linux の共有ライブラリを作るとき PIC でコンパイルするのはなぜか

    Linux の共有ライブラリを作るとき PIC でコンパイルするのはなぜか 通常、Linux の共有ライブラリを作るときは各 .c ファイルを PIC (Position Independent Code) となるようコンパイルします。しかし、実は PIC でコンパイルしなくても共有ライブラリは作れます。それでは PIC にする意味はあるのでしょうか。 さっそく実験してみます。 int func () { printf(""); printf(""); printf(""); } PIC でコンパイルするには gcc に -fpic または -fPIC を渡します。-fpic の方が小さく高速なコードを生成する可能性がありますが、プロセッサによっては -fpic で生成できる GOT (Global Offset Table) のサイズに制限があります。一方、-fPIC はどのプロセッサで

    hirose31
    hirose31 2007/05/24
    -fpic -fPIC
  • IBM Developer

    IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.

    IBM Developer
    hirose31
    hirose31 2007/05/23
    -finstrument-functions -g 関数コールのトレース
  • gccのprofiled optimization - フツーな日常

    CPUをアーキテクチャ指定による最適化の具合を調べていたんだけど、最近のgcc*1にはprofiled optimizationの機能が入っていることに気付いたのでこちらを測定してみた。 測定に使ったベンチマークはSciMark2.0のANSI C版。コンパイラはDebian sid/amd64のgcc version 4.2.1 20070516 (prerelease) (Debian 4.2-20070516-1)。 通常にコンパイルしたバイナリ ** ** ** SciMark2 Numeric Benchmark, see http://math.nist.gov/scimark ** ** for details. (Results can be submitted to pozo@nist.gov) ** ** ** Using 2.00 seconds min time p

    gccのprofiled optimization - フツーな日常
    hirose31
    hirose31 2007/05/22
    profiled optimization
  • 1