[Bug c/39456] Functions of a file in different named sections
etienne_lorrain at yahoo dot fr
gcc-bugzilla@gcc.gnu.org
Thu Mar 19 16:33:00 GMT 2009
------- 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.:
etienne@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.
etienne@gujin:~$ cat tmp.c
__attribute__((section(".extracode"))) int fct1 (void) {
return 1;
}
__attribute__((section(".extracode"))) int fct2 (void) {
return 2;
}
etienne@gujin:~$ gcc -Os -fomit-frame-pointer -ffunction-sections -S tmp.c -o
tmp.s
etienne@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
etienne@gujin:~$
So you cannot use garbage collection in the linker...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39456
More information about the Gcc-bugs
mailing list