This is the mail archive of the binutils@sourceware.cygnus.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]

Re: R_PPC_LOCAL24PC c++ linking problems with current binutils


   Date: Mon, 19 Jul 1999 20:51:35 -0400
   From: Daniel Jacobowitz <drow@false.org>

   I don't claim to understand this section, but if it truly makes no
   sense to point a local relocation at a symbol not in _this object_,
   then perhaps it is not safe to generate 'bl symbol@local' when symbol
   is in a linkonce section?

I think it's OK, although I'm not completely certain.

Note that ``this object'' in this case means ``this executable'' or
``this shared library.''

My reading of the egcs code is that gcc will use @local if the symbol
is static, or if it has already emitted code for the function in
question.  It's unlikely that gcc will generate a linkonce section for
a static function, so most likely this is the case in which it has
already emitted code for the function.  In that case, the only time
the linkonce section will not be used is when there is another
linkonce section of the same name in the ``same object,'' which
implies that it provides the same function, and that @local is OK.

I do wonder if there is a bug in gcc when it comes to calling a weak
function.  It looks as though gcc will generate @local when calling a
weak function, but that is unsafe.  I expect it would break cases in
which non-PIC code is put into a shared library, an operation which is
odd but legal.

Ian

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