编译内核section attribute错误

unbutun 2009-08-23 06:31:27
arch/arm/plat-s3c/include/plat/uncompress.h:67: error: section attribute cannot be specified for local variables
arch/arm/plat-s3c/include/plat/uncompress.h:74: error: section attribute cannot be specified for local variables
arch/arm/plat-s3c/include/plat/uncompress.h: In function 鈥榓rch_enable_uart_fifo鈥?
arch/arm/plat-s3c/include/plat/uncompress.h:147: error: section attribute cannot be specified for local variables
arch/arm/plat-s3c/include/plat/uncompress.h:154: error: section attribute cannot be specified for local variables
In file included from arch/arm/boot/compressed/misc.c:30:
arch/arm/mach-s3c2410/include/mach/uncompress.h: In function 鈥榓rch_detect_cpu鈥?
arch/arm/mach-s3c2410/include/mach/uncompress.h:43: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c: In function 鈥榠cedcc_putc鈥?
arch/arm/boot/compressed/misc.c:57: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c: In function 鈥榩utstr鈥?
arch/arm/boot/compressed/misc.c:77: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c: In function 鈥榑_memzero鈥?
arch/arm/boot/compressed/misc.c:112: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c:119: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c:124: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c:127: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c:132: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c: In function 鈥榤emcpy鈥?
arch/arm/boot/compressed/misc.c:153: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c:160: error: section attribute cannot be specified for local variables
arch/arm/boot/compressed/misc.c:165: error: section attribute cannot be specified for local variables
In file included from arch/arm/boot/compressed/misc.c:244:
arch/arm/boot/compressed/../../../../lib/inflate.c: In function 鈥榤alloc鈥?
.
.
.
.arch/arm/boot/compressed/misc.c: In function 鈥榝ill_inbuf鈥?
arch/arm/boot/compressed/misc.c:252: error: section attribute cannot be specified for local variables


编译内核报错,请问这个是什么问题,大家帮忙。
...全文
832 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuyu1989314 2011-03-30
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 unbutun 的回复:]
已经找到原因:
KFT的profile all if conditionals的原因,去掉就行。
[/Quote]
请问KFT是什么
liuyu1989314 2011-03-30
  • 打赏
  • 举报
回复
请问KFT是什么?
unbutun 2009-08-30
  • 打赏
  • 举报
回复
已经找到原因:
KFT的profile all if conditionals的原因,去掉就行。
ShowMan 2009-08-27
  • 打赏
  • 举报
回复
section ("section-name")
Normally, the compiler places the objects it generates in sections like data and bss. Sometimes, however, you need additional sections, or you need certain particular variables to appear in special sections, for example to map to special hardware. The section attribute specifies that a variable (or function) lives in a particular section. For example, this small program uses several specific section names:
struct duart a __attribute__ ((section ("DUART_A"))) = { 0 };
struct duart b __attribute__ ((section ("DUART_B"))) = { 0 };
char stack[10000] __attribute__ ((section ("STACK"))) = { 0 };
int init_data __attribute__ ((section ("INITDATA"))) = 0;

main()
{
/* Initialize stack pointer */
init_sp (stack + sizeof (stack));

/* Initialize initialized data */
memcpy (&init_data, &data, &edata - &data);

/* Turn on the serial ports */
init_duart (&a);
init_duart (&b);
}

Use the section attribute with an initialized definition of a global variable, as shown in the example. GCC issues a warning and otherwise ignores the section attribute in uninitialized variable declarations.

You may only use the section attribute with a fully initialized global definition because of the way linkers work. The linker requires each object be defined once, with the exception that uninitialized variables tentatively go in the common (or bss) section and can be multiply “defined”. You can force a variable to be initialized with the -fno-common flag or the nocommon attribute.

Some file formats do not support arbitrary sections so the section attribute is not available on all platforms. If you need to map the entire contents of a module to a particular section, consider using the facilities of the linker instead.
sundl2268 2009-08-27
  • 打赏
  • 举报
回复
好复杂呀
unbutun 2009-08-26
  • 打赏
  • 举报
回复
up
unbutun 2009-08-23
  • 打赏
  • 举报
回复
不是,我想是menuconfig里的哪个选项选的不对,因为我make defconfig后就可以编过,但是选项太多了,我对不过来,所以到这来问问大家,有没有遇到过,hehe
eijikayn 2009-08-23
  • 打赏
  • 举报
回复
是不是编译器不对瓦
DarkChampion 2009-08-23
  • 打赏
  • 举报
回复
section attribute可以参看这里:
http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html

DarkChampion 2009-08-23
  • 打赏
  • 举报
回复
还有乱码

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧