[uClibc] [patch] ia64 support for busybox's insmod

Mike Frysinger vapier at gentoo.org
Thu Sep 2 03:15:31 UTC 2004


was playing with busybox on an ia64 and i tossed together this patch ... it 
also got me thinking ... forgive me if the following sounds pretty weak but 
i'm an elf newbie ;)

in order to port insmod onto a new arch, you need to know the following 4 
details:
- the elf EM_ define for machine matching (this is easy, just read asm/elf.h 
from the kernel headers and look at the elf_check_arch() definition)
- the bit size for ELFCLASSM ... again, pretty easy ... just look up the CPU
- elf sh type ... either SHT_REL or SHT_RELA
- Elf*_RelM info ... this will depend on bit size and sh type

my question is, how do you know whether SH_REL or SH_RELA is the correct one ?

i looked at `readelf -S <some binary file>` on an i386/amd64/ia64/sparc 
machine and compared them ... they all had RELA or REL sections but none had 
both ...

here's what i found from `readelf`:
i386: REL
native amd64: RELA
amd64 32bit/i386-compat libs: REL
ia64: RELA
sparc: RELA

so i compared this to what i had in busybox so far:
<cvs>
i386: REL
amd64: REL
<me>
ia64: RELA
sparc: RELA

so the question is, are the two patches ive sent up (ia64/sparc) correct ?  i 
was able to `insmod` modules with them just fine so i guess they are ... and 
is the amd64 entry correct ?  or should it be changed to have RELA entries 
instead of REL ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-insmod-ia64.patch
Type: text/x-diff
Size: 436 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20040901/c0908445/attachment.bin 


More information about the uClibc mailing list