Article View: gnu.gcc.help
Article #42084Structure of ELF object files
From: Kryten
Date: Mon, 22 Jan 1996 00:00
Date: Mon, 22 Jan 1996 00:00
39 lines
2171 bytes
2171 bytes
Dear All, This is not an enquiry from a lazy bastard who isn't prepared to read a book. It's regarding the relocation of ELF object (relocatable) files as supported by Gnu C under later versions of Linux. I am part way through implementing a dynamic linker for ELF object files, but have hit upon a problem which won't go away. Unfortunately, I do have ELF documentation, but either it is wrong, or my interpretation leaves a lot to be desired. At this stage, I'll give an outline of the problem to see if anyone's interested in helping out, and a more detailed description when I'm sure someone's listening. So, here goes... The 'Relocation Section' gives me offsets into the text section for function calls. When I add the text section offset onto the offsets supplied for all the calls to a particular function, I theoretically have the virtual locations in the object of all the calls to a particular function. It is through writing an address to all the places where calls exist for a particular function that the function can be relocated. So far, so good. However, when I add the call offset in the Relocation Section onto the text section offset, and put the correct address at the resultant location, 'Segmentation Fault' is the helpful response that Linux gives me. To the best of my knowledge, I am following the documentation that I have to the letter. (By the way, it is entitled simply "ELF", and is released by Tool Interface Standards.) Can anyone help? Does anyone have any other documentation? Does my description of the problem highlight a flaw in my understanding of the ELF format? Any assistance would be greatly appreciated. (Oh, and by the way, thanks for getting this far in what needed to be an overly long message.) Clive Duffy.
Technical Details
Message-ID:
<4e0djr$ep@bs33n.staffs.ac.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,973245bc6ccdbb0e,start X-Google-Attributes: gid11318c,public From: cm2bccjd@bs47c.staffs.ac.uk ( Kryten) Subject: Structure of ELF object files Date: 1996/01/22 Message-ID: <4e0djr$ep@bs33n.staffs.ac.uk> X-Deja-AN: 136061276 organization: Staffordshire University newsgroups: gnu.gcc.help