extern void f(void);
extern void g(void);
extern void h(void);
#include "g.h" int main(int argc,char *argv[]) { g(); return; }
void f() { return; }
#include "f.h" #include "h.h" void g() { f(); h(); return; }
#include "f.h" static void g() { return; } void h() { f(); g(); }
# 1 "prog.c" # 1 "g.h" 1 extern void g(void); # 1 "prog.c" 2 int main(int argc,char *argv[]) { g(); return; }
# 1 "f.c" void f() { return; }
# 1 "g.c" # 1 "f.h" 1 extern void f(void); # 1 "g.c" 2 # 1 "h.h" 1 extern void h(void); # 2 "g.c" 2 void g() { f(); h(); return; }
# 1 "h.c" # 1 "f.h" 1 extern void f(void); # 1 "h.c" 2 static void g() { return; } void h() { f(); g(); }
.file "prog.c" gcc2_compiled.: .section ".text" .align 4 .global main .type main,#function .proc 04 main: !#PROLOGUE# 0 save %sp,-112,%sp !#PROLOGUE# 1 st %i0,[%fp+68] st %i1,[%fp+72] call g,0 nop b .LL1 nop .LL1: ret restore .LLfe1: .size main,.LLfe1-main .ident "GCC: (GNU) 2.8.1"
.file "f.c" gcc2_compiled.: .section ".text" .align 4 .global f .type f,#function .proc 020 f: !#PROLOGUE# 0 save %sp,-112,%sp !#PROLOGUE# 1 b .LL1 nop .LL1: ret restore .LLfe1: .size f,.LLfe1-f .ident "GCC: (GNU) 2.8.1"
.file "g.c" gcc2_compiled.: .section ".text" .align 4 .global g .type g,#function .proc 020 g: !#PROLOGUE# 0 save %sp,-112,%sp !#PROLOGUE# 1 call f,0 nop call h,0 nop b .LL1 nop .LL1: ret restore .LLfe1: .size g,.LLfe1-g .ident "GCC: (GNU) 2.8.1"
.file "h.c" gcc2_compiled.: .section ".text" .align 4 .type g,#function .proc 020 g: !#PROLOGUE# 0 save %sp,-112,%sp !#PROLOGUE# 1 b .LL1 nop .LL1: ret restore .LLfe1: .size g,.LLfe1-g .align 4 .global h .type h,#function .proc 020 h: !#PROLOGUE# 0 save %sp,-112,%sp !#PROLOGUE# 1 call f,0 nop call g,0 nop .LL2: ret restore .LLfe2: .size h,.LLfe2-h .ident "GCC: (GNU) 2.8.1"
prog.o: [Index] Value Size Type Bind Other Shndx Name [3] | 0| 0|SECT |LOCL |0 |2 | [4] | 0| 0|NOTY |GLOB |0 |UNDEF |g [2] | 0| 0|NOTY |LOCL |0 |2 |gcc2_compiled. [5] | 0| 36|FUNC |GLOB |0 |2 |main [1] | 0| 0|FILE |LOCL |0 |ABS |prog.cOn voit apparaître le symbole g comme non défini, ainsi que le symbole de fonction main comme global (et donc visible de l'extérieur).
f.o: [Index] Value Size Type Bind Other Shndx Name [3] | 0| 0|SECT |LOCL |0 |2 | [4] | 0| 20|FUNC |GLOB |0 |2 |f [1] | 0| 0|FILE |LOCL |0 |ABS |f.c [2] | 0| 0|NOTY |LOCL |0 |2 |gcc2_compiled.
g.o: [Index] Value Size Type Bind Other Shndx Name [3] | 0| 0|SECT |LOCL |0 |2 | [4] | 0| 0|NOTY |GLOB |0 |UNDEF |f [5] | 0| 36|FUNC |GLOB |0 |2 |g [1] | 0| 0|FILE |LOCL |0 |ABS |g.c [2] | 0| 0|NOTY |LOCL |0 |2 |gcc2_compiled. [6] | 0| 0|NOTY |GLOB |0 |UNDEF |h
h.o: [Index] Value Size Type Bind Other Shndx Name [4] | 0| 0|SECT |LOCL |0 |2 | [5] | 0| 0|NOTY |GLOB |0 |UNDEF |f [2] | 0| 20|FUNC |LOCL |0 |2 |g [3] | 0| 0|NOTY |LOCL |0 |2 |gcc2_compiled. [6] | 20| 28|FUNC |GLOB |0 |2 |h [1] | 0| 0|FILE |LOCL |0 |ABS |h.c
prog: [Index] Value Size Type Bind Other Shndx Name [78] | 68244| 20|FUNC |GLOB |0 |8 |f [47] | 0| 0|FILE |LOCL |0 |ABS |f.c ... [79] | 68264| 36|FUNC |GLOB |0 |8 |g [52] | 68300| 20|FUNC |LOCL |0 |8 |g [49] | 0| 0|FILE |LOCL |0 |ABS |g.c ... [80] | 68320| 28|FUNC |GLOB |0 |8 |h [51] | 0| 0|FILE |LOCL |0 |ABS |h.c ... [104] | 68208| 36|FUNC |GLOB |0 |8 |main ... [1] | 0| 0|FILE |LOCL |0 |ABS |prog [45] | 0| 0|FILE |LOCL |0 |ABS |prog.c