lkml.org 
[lkml]   [2001]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date

Russell King writes:
> ip_nat_standalone.c:
>
> static int init_or_cleanup(int init)
> {
> ...
> cleanup_nat:
> ip_nat_cleanup();
> ...
> }

Call ip_nat_cleanup();

> ip_nat_core:
>
> void __exit ip_nat_cleanup(void)
> {
> ip_ct_selective_cleanup(&clean_nat, NULL);
> ip_conntrack_destroyed = NULL;
> }

Define ip_nat_cleanup() as an __exit function.

> *Don't* do this - its fundamentally wrong. Code in the kernel should _not_
> reference code that has been removed by the linker.

Why would ip_nat_cleanup() be removed by the linker? All the "unused"
attribute should do is shut up gcc if the thing is marked static yet
not called. The GCC manual even states "... means that the function
is meant to be possibly unused. GNU CC will not produce a warning
for this function." It makes no mention of any effect on the actual
code output, or that the linker will delete it.

It doesn't remove the function on any platform I could test this on.

If the linker removed it, why did it give a relocation truncation
error instead of a missing symbol error? And more importantly, what
specifically was the reason that the linker removed the function on
ARM, what made this happen?

Please explain this in detail so we don't have to guess as I have
seen no other report of this.

Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.052 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site