[parisc-linux] kdb_v21 branch updated to -pa26, and kallsyms cross-compile

Carlos O'Donell Jr. carlos@baldric.uwo.ca
Mon, 27 May 2002 00:13:21 -0400


Parisc,

All the changes from -pa24 to -p26 have been merged into the
kdb-v21 tree (that Randolph graciously started!). Thanks go
to bame's recipe!

A few tests show that it is equivalent to the patches I had 
produced (fixes to traps.c for the soft power button).

If kdb is your bag, then it should all be set to go!

---

On another note... until I get a really fast PA box, I'm going
to be cross-compiling all the time. There are issues cross-compiling 
a kdb'd kernel, and the problem is called 'kallsyms'.

After a bout of idiocy and help from Jess I had a cross version
of kallsyms (never forget to 'unset CC'). 

It seemed like I was home free, except that I ran into the same
problem as before (even with the supposed _new_ cross kallsyms).

.tmp_vmlinux1: ELF file .tmp_vmlinux1 not for this architecture

I check ./src/modutils/obj/obj_load.c and find:

  if (f->header.e_ident[EI_CLASS] != ELFCLASSM
      || f->header.e_ident[EI_DATA] != ELFDATAM
      || f->header.e_ident[EI_VERSION] != EV_CURRENT
      || !MATCH_MACHINE(f->header.e_machine))
    {
       error("ELF file %s not for this architecture", filename);
       return NULL;
    }

So I breakup the values and test individually...

.tmp_vmlinux1: ELF file .tmp_vmlinux1 not for this architecture (!MATCH_MACHINE)

The MATCH_MACHINE macro is pretty dumb.
#define MATCH_MACHINE(x)  (x == EM_PARISC)

printf what e_machine header is set to:

ELF e_machine header is 3840
.tmp_vmlinux1: ELF file .tmp_vmlinux1 not for this architecture (!MATCH_MACHINE)

I'm not sure I've _ever_ seen a EM_??? value that big (EM_PARISC=15).
A closer inspection reveals that 3840 is 15 but byte swapped.

Which leaves me wondering... what else is going to be bytesex broke in
a cross modutils?

Is anyone familiar with modutils?
What would be a good way to include some cross-kallsyms support?

c.