Arnd Bergmann <arnd@xxxxxxxx> wrote: > The method I try to use for architectures overriding asm-generic definitions > is to make the architecture define the same symbol, like > > #ifdef CONFIG_ARM_UNWIND > struct mod_arch_specific { > struct unwind_table *unwind[ARM_SEC_MAX]; > }; > #define mod_arch_specific mod_arch_specific > #endif > > and then let the asm-generic version test that using > > #ifndef mod_arch_specific > struct mod_arch_specific {}; > #endif Ewww. That's even ickier. > I believe all architectures have either one or the other, but never both or > neither of the two, right? If so, we only need one symbol here. That's probably the case, but I don't know which it is for which arch, or whether it has changed during the lifetime of an arch, requiring both to be supported for that arch. > some time back to provide a default so architectures no longer need > to provide the apply_relocate function for both cases. If we have the > Kconfig symbol you introduce, we can turn this into an nice inline > function and do > > #ifdef CONFIG_MODULES_USE_RELA_ONLY > static inline int __weak apply_relocate(Elf_Shdr *sechdrs, You don't then need the __weak attributes. > and consequently kill off the remaining empty functions. :-) David -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html