Re: [PATCH] Make most arch asm/module.h files use asm-generic/module.h [ver #2]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 19, 2012 at 12:40:46PM +0100, David Howells wrote:
> 
> David Howells <dhowells@xxxxxxxxxx> wrote:
> 
> > +static inline int apply_relocate(Elf_Shdr *sechdrs,
> > +				 const char *strtab,
> > +				 unsigned int symindex,
> > +				 unsigned int relsec,
> > +				 struct module *me)
> > +{
> > +	pr_err("module %s: REL relocation unsupported\n", me->name);
> > +	return -ENOEXEC;
> > +}
> 
> Turns out you cannot use pr_err() and friends in a header file, lest it get
> included in a file that defines pr_fmt() to be something inconvenient.
> 
> Thanks to Fengguang and his GIT tree cruncher for finding this in Blackfin
> with the BF526-EZBRD_defconfig.

For completeness, here are the error messages and David's comments:

>> In file included from arch/blackfin/kernel/module.c:9:0:
>> include/linux/moduleloader.h: In function 'apply_relocate':
>> include/linux/moduleloader.h:48:2: error: 'mod' undeclared (first use in this function)
>> include/linux/moduleloader.h:48:2: note: each undeclared identifier is reported only once for each function it appears in
>
>pr_err() is the problem.  If you're in a file that defines pr_fmt then it will
>use that.  At the top of arch/blackfin/kernel/module.c:
>
>        #define pr_fmt(fmt) "module %s: " fmt, mod->name
>
>I guess you can't use pr_err() in header files.

Thanks,
Fengguang
--
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


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux