This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Warning relocs against discarded functions
- To: Daniel Jacobowitz <drow at mvista dot com>
- Subject: Re: PATCH: Warning relocs against discarded functions
- From: Keith Owens <kaos at ocs dot com dot au>
- Date: Fri, 02 Nov 2001 11:49:53 +1100
- Cc: Geoff Keating <geoffk at redhat dot com>, hjl at lucon dot org, gdb at sources dot redhat dot com, binutils at sourceware dot cygnus dot com
On Thu, Nov 01, 2001 at 03:54:11PM -0800, Geoff Keating wrote:
>> Of course, this raises an interesting question: why not just use the
> c preprocessor to prevent the functions for this section being
> compiled in the first place?
Mainly source pollution. It is a lot cleaner to mark a function as
__exit_call or mark data as __exitdata and have the linker discard them
as required. To use cpp we would have to wrap #ifdef/#endif around
each definition. Linus does not like that ;).