Re: [PATCH 05/10] kbuild: sort the list of symbols exported by the kernel (__ksymtab)

From: Tony Luck
Date: Fri Nov 20 2009 - 17:20:21 EST


The sorted ksymtab breaks ia64 (and possibly ppc64 and
parisc too).

Alex Chiang did the bisect to find this change as
the cause of the breakage. The problem is that ia64
expects that the first item in each ksymtab entry to be
a function pointer. The code in modpost that creates
.tmp_exports-asm.S doesn't know about types of exported
objects, so it uses __EXPORT_SYMBOL from linux/mod_export.h
for everything. This results in

PTR SYM(sym);
PTR SYM(__kstrtab_##sym);

which the preprocessor expands to entries like:

.long ____pagevec_lru_add
.long __kstrtab____pagevec_lru_add

which puts the address of the first instruction of the
function into the table, rather than the address of a
function pointer (which on ia64 is a two element data
object containing the code address and the global data
pointer).

The syntax you need for this* is:

.long @fptr(____pagevec_lru_add)
.long __kstrtab____pagevec_lru_add

Note that you must only use the @fptr(name) syntax for
function exports. Exported data items just need an address.

-Tony

* On ia64 ... powerpc and parisc might need something else.
--
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/