editing ELF file


 
Thread Tools Search this Thread
Operating Systems Linux editing ELF file
# 1  
Old 05-05-2008
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/do...f/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 :-)

/tejas
# 2  
Old 05-18-2008
Just a thought, could you try dissassembling it and then re-assemble/re-link?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Install Apache 2.4.20 on Solaris 10 --- Error "ld: fatal: file ab.o: wrong ELF class: ELFCLASS32"

I am following the "Compilling and Installing" guide from Apache > HTTP Server > Documentation > Version 2.4 page The configure running OK: # export CC="gcc -m64" # ./configure \ --prefix=/usr/local/apache2/httpd-2.4.20 \ --with-port=80 \ --with-mpm=worker \ --enable-mods-shared=most \... (0 Replies)
Discussion started by: jhuang
0 Replies

2. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies

3. Shell Programming and Scripting

editing line in text file adding number to value in file

I have a text file that has data like: Data "12345#22" Fred ID 12345 Age 45 Wilma Dino Data "123#22" Tarzan ID 123 Age 33 Jane I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes: Data "1012345#22" Fred ID... (16 Replies)
Discussion started by: say170
16 Replies

4. Programming

A help to create an ELF file

Hi!!! How do I create a file .ELF? What code should I use, could help me with a simple code or example? I know programming to Windows by important languages but this seems to be more sistematical, and I really don't know how to. (2 Replies)
Discussion started by: linecoder
2 Replies

5. Solaris

Not a Vaild ELF File

Hi Anyone, I have two disks , one is primary and anothe is mirror. I checked my mirror disk , It was fine. After that i booted from my primary disk, did some installations regarding kernel patches. It did not get booted properly. It says ==================== Not a valid... (2 Replies)
Discussion started by: jegaraman
2 Replies

6. Programming

Reading ELF file Symbol table of C++ program

Folks, I have some program(Test.cpp) as follows, #include<iostream> class Abc { private: int _theVar; public : int printVar(); }; int Abc :: printVar() { _theVar=10; } main() { Abc _t; (2 Replies)
Discussion started by: vinod_chitrali
2 Replies

7. Linux

Reading ELF file Symbol table of C++ program

Folks, I have some program(Test.cpp) as follows, #include<iostream> class Abc { private: int _theVar; public : int printVar(); }; int Abc :: printVar() { _theVar=10; } main() { Abc _t; (0 Replies)
Discussion started by: vinod_chitrali
0 Replies

8. Programming

Editing or Adding to ELF string tables

Is it possible to add - or edit - data (the strings) contained within the string table of an ELF executable? I know I can access the string table with the following code; while ((scn = elf_nextscn(m_elf, scn)) != 0) { char *name = 0; gelf_getshdr(scn, &shdr); ... (9 Replies)
Discussion started by: Dhodder
9 Replies

9. UNIX for Advanced & Expert Users

How can i read a non text file in unix - ELF-64 executable object file - IA64

The binary file is ELF-64 executable object file - IA64. How i know that the source is Is there any comamnd in unix i can read these kind of files or use a thirty party software? Thanks for your help (8 Replies)
Discussion started by: alexcol
8 Replies

10. Filesystems, Disks and Memory

How to find Dependent libraries in ELF file?

Dear group, I need to load dependent libraries for an application which is in ELF format.please let me know how to parse the ELF file to find dependent libraries. thnaks in advance, Ravinder (3 Replies)
Discussion started by: ravinder.are
3 Replies
Login or Register to Ask a Question