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: --unresolved-symbols patch breaks autoconf tests


Hi Rainer,

>> ! 	  /* When linking against shared libraries, the default behaviour is
>> ! 	     to report any unresolved references.  This is for backwards
>> ! 	     comptability with previous linker behaviour.  Whilst strictly
>> ! 	     speaking it is not a failure to encounter unresolved symbols at
>> ! 	     link time - the symbol *might* be available at load time - it is
>
> I find this comment misleading: while under unusual circumstances where
> different libraries are used at runtime than at link time the missing
> symbols might be present, in the usual case where link-time and runtime
> libraries are identical, failure to find symbols at link time is a strong
> indication that the resulting dynamic executable won't work.  So the old
> behavior is certainly correct, not only for backwards compatiblity with
> autoconf.  It should fall on the user in unusual situations (where
> link-time libraries differ from their runtime counterparts) to avoid the
> linker error by specifying the necessary ld switches: the regular user
> should see the old behaviour.

Very well.  I have revised the comment to read as follows:

  /* When linking against shared libraries, the default behaviour is
     to report any unresolved references.  Although strictly speaking
     it is not a failure to encounter unresolved symbols at link time
     - the symbol *might* be available at load time - it is a strong
     indication that the resulting executable will not work.  Plus it
     is necessary for the correct execution of the autoconf package,
     which needs to be able to detect functions that are not provided
     by the host OS.  */

I hope that this is OK by you.
             
>>   	  if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
>>   	    link_info.unresolved_syms_in_objects = RM_IGNORE;
>
> This is still wrong: unresolved symbols in objects must not be ignored.
> This should probably be how_to_report_unresolved_symbols instead of
> RM_IGNORE.  At least this fixes my testcase.

Good point.  I had intended to change that as well and forgot.  I have
checked in a patch to take care of this.

Cheers
        Nick

ld/ChangeLog        
2003-10-08  Nick Clifton  <nickc@redhat.com>

	* lexsup.c (parse_args: OPTION_CALL_SHARED): Revise comment
	describing defaults.  Change default to report unresolved symbols
	in object files as well.

        


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