This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inject so into elf


Hi,
	I am trying to rewrite elf so that my own dll can be loaded next
time. I've added a new Elf64_Dyn entry at the .dynamic segment, just
before the last DT_NULL entry. And, I append the dll name to the end of
the .dynstr whose attributes are designated by DT_STRTAB and DT_STRSZ.
Both the .dynamic segment and .dynstr are moved to the end of the file.
Finally, I rewrite the program header (DT_DYNAMIC), while adding a new
PT_LOAD segment to load the new .dynstr and .dynamic segments.
	After all these are done, I've got msg:  /lib/tls/libc.so.6.1:
version `libbetto.so' not found . (betto is my lib name)
	What the things that I've missed? And is there any better way to
inject my own dll into an elf  file (not a process)?
Thanks,
Zhenyu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]