Re: [PATCH v1 08/10] kgdb: Remove "weak" from kgdb_arch_pc() declaration

From: Vineet Gupta
Date: Thu Oct 16 2014 - 09:41:53 EST


Hi Bjorn,

On Thursday 16 October 2014 05:05 AM, Bjorn Helgaas wrote:
> [+cc Harvey, Vineet, linux-sh; arc, sh, and x86 have kgdb_arch_pc()
> definitions and could see issues from this]

Thanks for the heads up !

I compile tested arc tree (with kgdb) from linux-next of today, which has this
patch already and things seem to be ok.

As a hack I reverted the patch and see that kgdb_arch_pc() becomes weak, although
ARC version was still being pulled in final - it was recored as weak and that
cause bloat-o-meter to go awry.

bloat-o-meter vmlinux-with-fix vmlinux-before-fix
add/remove: 0/1 grow/shrink: 1/0 up/down: 1/-8 (-7)
function old new delta
vermagic 36 37 +1
kgdb_arch_pc 8 - -8

So functionally we are same as before - which is good.
If you need it.

Tested-by: Vineet Gupta <vgupta@xxxxxxxxxxxx> #for ARC build

Thx,
-Vineet
>
> On Wed, Oct 15, 2014 at 11:06 AM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote:
>> kernel/debug/debug_core.c provides a default kgdb_arch_pc() definition
>> explicitly marked "weak". Several architectures provide their own
>> definitions intended to override the default, but the "weak" attribute on
>> the declaration applied to the arch definitions as well, so the linker
>> chose one based on link order (see 10629d711ed7 ("PCI: Remove __weak
>> annotation from pcibios_get_phb_of_node decl")).
>>
>> Remove the "weak" attribute from the declaration so we always prefer a
>> non-weak definition over the weak one, independent of link order.
>>
>> Fixes: 688b744d8bc8 ("kgdb: fix signedness mixmatches, add statics, add declaration to header")
>> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
>> CC: Harvey Harrison <harvey.harrison@xxxxxxxxx>
>> ---
>> include/linux/kgdb.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
>> index 6b06d378f3df..e465bb15912d 100644
>> --- a/include/linux/kgdb.h
>> +++ b/include/linux/kgdb.h
>> @@ -283,7 +283,7 @@ struct kgdb_io {
>>
>> extern struct kgdb_arch arch_kgdb_ops;
>>
>> -extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs);
>> +extern unsigned long kgdb_arch_pc(int exception, struct pt_regs *regs);
>>
>> #ifdef CONFIG_SERIAL_KGDB_NMI
>> extern int kgdb_register_nmi_console(void);
>>

--
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/