This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Reloc info of static functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]