Date: Wed, 29 Sep 2010 10:18:22 +0200 From: PL <kadupl@wp.pl> To: freebsd-hackers@freebsd.org Subject: question regarding link_elf.c Message-ID: <4ca2f64ee66683.99262397@wp.pl>
next in thread | raw e-mail | index | archive | help
Hi everyone, I'm not quiet sure if it is proper place to ask the question I have. If not, please direct me to the correct place I should post questions like: Im working on some modifications around link_elf.c. According to elf(5) man pages, Elf_Shdr structure contains field called 'sh_addr', containing the address at which first byte of a section shall reside in the memory image. I am particularily interested in '.text' and '.data' sections. After link_elf_load_file() loads the file into a memory, we have linker_file structure filled in, including 'address' field. Now, assuming 'lf' being linker_file_t, already filled in by the loading routine, 'text_sh' being 'Elf_Shdr' for text section, and 'data_sh' being 'Elf_Shdr' for data section: - lf->address + text_sh.sh_addr really points to the beginning of a '.text' section in memory, however.. - lf->address + data_sh.sh_addr does not point to the valid location of '.data' section in memory. Sorry if my question is stupid, but im wondering why it is so ? I guess it has something to do with virtual memory mapping (?). Thanks in advance for your kind help.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ca2f64ee66683.99262397>