------- Comment #1 from etienne_lorrain at yahoo dot fr 2009-03-19 16:33 ------- Also, you cannot put function in another section and then use -ffunction-sections, i.e.:
etie...@gujin:~$ gcc --version gcc (Debian 4.3.3-3) 4.3.3 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. etie...@gujin:~$ cat tmp.c __attribute__((section(".extracode"))) int fct1 (void) { return 1; } __attribute__((section(".extracode"))) int fct2 (void) { return 2; } etie...@gujin:~$ gcc -Os -fomit-frame-pointer -ffunction-sections -S tmp.c -o tmp.s etie...@gujin:~$ cat tmp.s .file "tmp.c" .section .extracode,"ax",@progbits .globl fct1 .type fct1, @function fct1: movl $1, %eax ret .size fct1, .-fct1 .globl fct2 .type fct2, @function fct2: movl $2, %eax ret .size fct2, .-fct2 .ident "GCC: (Debian 4.3.3-3) 4.3.3" .section .note.GNU-stack,"",@progbits etie...@gujin:~$ So you cannot use garbage collection in the linker... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39456