[hellogcc] Re: [hellogcc] ld脚本能否排除某个目录下的文件或者某个文件的section?

  • From: Mingjie Xing <mingjie.xing@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Tue, 1 Nov 2011 18:37:33 +0800

2011/11/1 xunxun <xunxun1982@xxxxxxxxx>:
>    现在我想问,能否keep时排除一些文件的.eh_frame,或者能否判断当前生成 dll时才keep,静态库可以去除,不知道在linker脚本中该
> 如何表达?

我在现有的链接脚本里找到个例子,可以参考一下:

    /* We don't want to include the .ctor section from
       from the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))

邢明杰

Other related posts:

  • » [hellogcc] Re: [hellogcc] ld脚本能否排除某个目录下的文件或者某个文件的section? - Mingjie Xing