flat assembler
Message board for the users of flat assembler.

Index > Linux > ELF loader/dynamic linker

Author
Thread Post new topic Reply to topic
Artlav



Joined: 23 Dec 2004
Posts: 188
Location: Moscow, Russia
Artlav
Iam writing a loader/dynamic linker of ELF binaries for windows, and got stuck with some symbols relocations.

Specifically, program (any of coreutils) contains following code:
Code:
mov edx,[0804C744h]
mov eax,[edx+14h]
cmp eax,[edx+18h]
jnb ...
    

The 0804C744h offset is in the empty space after the program image, so i assume it should be filled by linker.

The address is found in .dynsym like that:
Code:
st_name="opterr",st_value=0x0804C740,st_size=0x00000004,st_info=0x11,st_other=0x00,st_shndx=0x0017
st_name="stdout",st_value=0x0804C744,st_size=0x00000004,st_info=0x11,st_other=0x00,st_shndx=0x0017
st_name="stderr",st_value=0x0804C748,st_size=0x00000004,st_info=0x11,st_other=0x00,st_shndx=0x0017
    

So, i assume that something about stdout should be at that address.

The question is, what should it be?
Looks like a file description struct, but mingw one doesn't fit the code, and i wasn't able to locate linux one description in glibc or kernel sources.

Or, more generally, where could i get a comprehensible manual on meaning of .got, .got.plt values, usage and ELF loading process in general (other than TIS ELF.pdf and glibc and linux sources)?
Post 22 Sep 2007, 21:00
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.