Re: [PATCH] module: set ksymtab/kcrctab* section addresses to 0x0

From: Rabin Vincent
Date: Tue Jan 27 2015 - 14:58:46 EST


On Tue, Jan 27, 2015 at 10:20:32AM +1030, Rusty Russell wrote:
> Rabin Vincent <rabin.vincent@xxxxxxxx> writes:
> > These __ksymtab*/__kcrctab* sections currently have non-zero addresses.
> > Non-zero section addresses in a relocatable ELF confuse GDB and it ends
> > up not relocating all symbols when add-symbol-file is used on modules
> > which have exports. The kernel's module loader does not care about
> > these addresses, so let's just set them to zero.
>
> You're right, we don't use sh_addr. This should be safe, I've
> applied it for the next merge window.

Thanks.

> AFAICT this would have always been a problem; wonder if it should be
> CC:stable? I don't use gdb on modules so haven't got a good feel for
> how many people this would be hurting.

I've no opinion on -stable. This method of debugging kernel modules is
described in for example LDD3, so it would be nice if it worked in all
cases, but I guess most people won't be affected even if they use it
since it only affects modules with exported symbols.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/