This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: when an executable is loaded, it's address will be changed?
- From: Ian Lance Taylor <ian at airs dot com>
- To: Ge Jun <gejun at iastate dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: 23 Jul 2003 08:43:42 -0700
- Subject: Re: when an executable is loaded, it's address will be changed?
- References: <3F1EA3C9.2090608@cs.iastate.edu>
Ge Jun <gejun@iastate.edu> writes:
> An executable's code has already the absolute address(or the relative
> address in that section?) in it. For
> example, the "nm" tool can list the address of the labels.
>
> My question is, when the executable is loaded by linux, will the
> address be changed?
No, the address of an executable will not be changed. (The address of
a shared library may--indeed, probably will--be changed when it is
loaded.)
In other words, it is not a requirement that the code in an executable
be position independent.
Ian