This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: linker garbage collector
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: Sivaprasad <sivaprasad dot pv at redpinesignals dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 31 Jul 2015 16:11:36 +0530
- Subject: Re: linker garbage collector
- Authentication-results: sourceware.org; auth=none
- References: <55BA06C2 dot 8010903 at redpinesignals dot com>
On Thu, Jul 30, 2015 at 04:43:06PM +0530, Sivaprasad wrote:
> I have complied my project with -ffunction-sections -fdata-sections compiler
> options (observed separate section generated for each function) and trying
> to use --gc-sections option while linking.No changes in executable size,
> unused functions are still present in executable file.
>
> Binutils version used : 2.23
>
> Please help me, to resolve this issue.
>
Perhaps your linker script has KEEP directives for those sections?
If not,one way to debug this is to have the linker keep relocation information
in the linked ELF (--emit-relocs). Dumping that information via objdump
or readelf and grepping for function section names should show you the
sections referencing those supposed-to-be-gc'ed sections.
Regards
Senthil