editing ELF file

Hello,

This is not exactly relevant to Linux kernel but I'm gonna ask any way.

Is there any way I can modify a 64-bit ELF object file to make it look like 32-bit ELF object file and link it (using `ld`) with 32-bit ELF file?

I tried libelf but was unsuccessful. I had this pretty link http://people.freebsd.org/~jkoshy/download/libelf/article.html from Freebsd website and it seems like the libelf library on Freebsd system is not similar to that on Linux system as it complained for "vis.h" headerfile and few library calls such as `elf_setshstrndx()`

Any suggestions?

Thanks :slight_smile:

/tejas

Just a thought, could you try dissassembling it and then re-assemble/re-link?