This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to control segments ?
- From: Sterling Augustine <sterling at tensilica dot com>
- To: Dong Phuong <dongphuong2410 at yahoo dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 03 Dec 2008 09:11:36 -0800
- Subject: Re: How to control segments ?
- References: <962482.47634.qm@web31909.mail.mud.yahoo.com>
Dong Phuong wrote:
Could you please explain more details about this :
"These long-call sequences are marked by a
relocation". I don't understand what is "marked by a
relocation".
"Relocation" is the process of connecting symbolic references to
symbolic definitions. "A relocation" is a note to the linker describing
a symbolic reference that the linker needs to resolve.
You can think about it (somewhat imprecisely) as a note to the linker
that some pointer points to an object with an unknown address. When the
linker figures out the object's address, it patches up the pointer with
the correct value.
If all this is new to you, you might find these old, but still relevant
articles helpful:
http://www.linuxjournal.com/article/6463
http://www.linuxjournal.com/node/1060/print
What the linker does when it encounters a particular relocation is up to
you. It can simply fill in an address or it can modify the instruction
itself.