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 Nick,

> --- 660,678 ----
>   	  break;
>   	case OPTION_CALL_SHARED:
>   	  config.dynamic_link = TRUE;
> ! 	  /* 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.

> ! 	     nevertheless necessary for the correct execution of the autoconf
> ! 	     package.  (It needs to be able to detect functions that are not
> ! 	     provided by the host OS).  Since this package is used by lots of
> ! 	     projects, maintaining the old linker behaviour is important.  */
>   	  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.

>   	  if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
> ! 	    link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
>   	  break;
>   	case OPTION_NON_SHARED:
>   	  config.dynamic_link = FALSE;

	Rainer


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