This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Reloc info of static functions
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: pradeep tumati <ptumati at yahoo dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 15 Oct 2003 21:19:24 -0700
- Subject: Re: Reloc info of static functions
- References: <20031016035942.22898.qmail@web13901.mail.yahoo.com>
pradeep tumati <ptumati@yahoo.com> writes:
> I am currently facing a strange issue. The GAS
> (binutilities-2.13.90) assembler is not including the
> relocation information of static C functions (x86, ELF
> object file). The sym info of static functions is
> present, but the relocation info is absent.
There is no need to keep any relocation information for a call to a
static function on the x86, because the call is PC relative and
therefore can be fully resolved in the assembler.
When calling a globally visible function, the ELF rules require that
relocation information be kept, because the .o may be linked into a
shared library and some other global function may override the one in
the same file.
> Is there any specific reason for not including the
> relocation information?
The resulting .o file will link faster, because it has less relocation
information.
> I am currently working on a project in which we need
> the relocation info of all the functions (static and
> non-static). I am thinking of modifying the gas
> assembler source code. I don't know where to start
> looking in the source code. I am totally new to GAS
> source code. Can anyone place point out the names of
> functions that are the start points to solve this
> issue... (A sample is shown below)
TC_FORCE_RELOCATION_LOCAL in gas/config/tc-i386.h.
Ian