Re: [PATCH] parisc: fix module loading failure of large kernel modules (take 4)

Roland Dreier
2008-12-31T17:36:22Z

> Some gcc versions will inline weak functions if they are in scope - even
> if there is a non-weak function somewhere else. So you MUST NOT have the
> weak definition in the same file (or indirectly called through some inline
> functions in a header file) as the call. Because if you do, then any user
> with the wrong version of gcc will get the weak function semantics, even
> if it was meant to be overridden by something else.

Does this mean lib/swiotlb.c is broken now? It has eg:

void * __weak swiotlb_alloc_boot(size_t size, unsigned long nslabs)

and then

void __init
swiotlb_init_with_default_size(size_t default_size)
{
...
io_tlb_start = swiotlb_alloc_boot(bytes, io_tlb_nslabs);

later on in the same file.

(I just notice this because I saw the warning about swiotlb_alloc_boot()
not being __init but calling __alloc_bootmem_low and so I looked at the
code yesterday)

- R.