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,

>> Err, why ?  I understood that dynamic executables (ie ones linked
>> against shared libraries) could have unresolved symbols at link
>> time.  The reason being that the true resolution of these symbols
>> happens at load time, and it is not possible to guarantee that the
>> shared libraries available at link time will be exactly the same as
>> the shared libraries available at load time.

Ok then , does anyone have any objections to my applying the patch
below, which restores the linker's default behaviour when creating
dynamic executables - ie reporting unresolved symbols ?

Cheers
        Nick

2003-10-03  Nick Clifton  <nickc@redhat.com>

	* lexsup.c (parse_args): Report unresolved symbols in shared
	libraries when creating a dynamic executable.  This is a
	restoration of the default behaviour for previous versions of
	the linker.

Index: ld/lexsup.c
===================================================================
RCS file: /cvs/src/src/ld/lexsup.c,v
retrieving revision 1.66
diff -c -3 -p -r1.66 lexsup.c
*** ld/lexsup.c	20 Aug 2003 08:37:15 -0000	1.66
--- ld/lexsup.c	3 Oct 2003 13:08:58 -0000
*************** parse_args (unsigned argc, char **argv)
*** 660,671 ****
  	  break;
  	case OPTION_CALL_SHARED:
  	  config.dynamic_link = TRUE;
! 	  /* When linking against shared libraries, the default
! 	     behaviour is to ignore any unresolved references.  */
  	  if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
  	    link_info.unresolved_syms_in_objects = RM_IGNORE;
  	  if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
! 	    link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
  	  break;
  	case OPTION_NON_SHARED:
  	  config.dynamic_link = FALSE;
--- 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
! 	     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;
  	  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;
        


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