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
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
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
2. UNIX for Advanced & Expert Users
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
3. Programming
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
4. Linux
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
5. Programming
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
6. Solaris
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
7. Programming
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Solaris
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
LEARN ABOUT MOJAVE
libelf
libelf(3LIB) Interface Libraries libelf(3LIB)
NAME
libelf - ELF access library
SYNOPSIS
cc [ flag... ] file... -lelf [ library... ]
#include <libelf.h>
DESCRIPTION
Functions in this library provide routines to manipulate ELF (Executable and Linking Format) object files, archive files, and archive mem-
bers. The header provides type and function declarations for all library services.
INTERFACES
The shared object libelf.so.1 provides the public interfaces defined below. See intro(3) for additional information on shared object inter-
faces.
elf32_checksum elf32_fsize
elf32_getehdr elf32_getphdr
elf32_getshdr elf32_newehdr
elf32_newphdr elf32_xlatetof
elf32_xlatetom elf64_checksum
elf64_fsize elf64_getehdr
elf64_getphdr elf64_getshdr
elf64_newehdr elf64_newphdr
elf64_xlatetof elf64_xlatetom
elf_begin elf_cntl
elf_end elf_errmsg
elf_errno elf_fill
elf_flagdata elf_flagehdr
elf_flagelf elf_flagphdr
elf_flagscn elf_flagshdr
elf_getarhdr elf_getarsym
elf_getbase elf_getdata
elf_getident elf_getscn
elf_getshnum elf_getshstrndx
elf_hash elf_kind
elf_memory elf_ndxscn
elf_newdata elf_newscn
elf_next elf_nextscn
elf_rand elf_rawdata
elf_rawfile elf_strptr
elf_update elf_version
gelf_checksum gelf_fsize
gelf_getcap gelf_getclass
gelf_getdyn gelf_getehdr
gelf_getmove gelf_getphdr
gelf_getrel gelf_getrela
gelf_getshdr gelf_getsym
gelf_getsyminfo gelf_getsymshndx
gelf_newehdr gelf_newphdr
gelf_update_cap gelf_update_dyn
gelf_update_ehdr gelf_update_move
gelf_update_phdr gelf_update_rel
gelf_update_rela gelf_update_shdr
gelf_update_sym gelf_update_symshndx
gelf_update_syminfo gelf_xlatetof
gelf_xlatetom nlist
FILES
/lib/libelf.so.1 shared object
/lib/64/libelf.so.1 64-bit shared object
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsl (32-bit) |
+-----------------------------+-----------------------------+
| |SUNWcslx (64-bit) |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO
pvs(1), intro(3), elf(3ELF), gelf(3ELF), attributes(5)
SunOS 5.10 8 June 2004 libelf(3LIB)