x86_64 and other targets finish_dynamic_symbol

Alan Modra amodra@gmail.com
Tue Feb 13 23:53:03 GMT 2024


elf_x86_64_finish_dynamic_symbol contains 

      else if (bfd_link_pic (info)
	       && SYMBOL_REFERENCES_LOCAL_P (info, h))
	{
	  if (!SYMBOL_DEFINED_NON_SHARED_P (h))
	    return false;

Returning false from finish_dynamic_symbol will not result in an error
being printed but will result in the linker exiting with a non-zero
status.  I reckon this particular "return false" cannot occur on
x86_64, but similar code in other target backends that have copied
older versions of the x86_64 code do.  eg. See the s390 patch I just
posted.

I propose changing all occurrences of "return false" in
finish_dynamic_symbol functions where targets don't first emit an
error message, to BFD_ASSERTs.  Opinions?

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list