RFC: Default to a start address of zero for shared libraries

Florian Weimer fweimer@redhat.com
Wed Sep 22 19:27:18 GMT 2021


* Nick Clifton via Binutils:

> diff --git a/ld/ldlang.c b/ld/ldlang.c
> index 2610be995ca..818ec44c318 100644
> --- a/ld/ldlang.c
> +++ b/ld/ldlang.c
> @@ -6984,7 +6984,8 @@ lang_end (void)
>  	  if (!bfd_set_start_address (link_info.output_bfd, val))
>  	    einfo (_("%F%P: can't set start address\n"));
>  	}
> -      else
> +      /* BZ 2004952: Only use the start of the entry section for executables.  */
> +      else if bfd_link_executable (&link_info)

Not sure if the downstream bug reference is appropriate here.

> @@ -7010,6 +7011,13 @@ lang_end (void)
>  		       entry_symbol.name);
>  	    }
>  	}
> +      else
> +	{
> +	  if (warn)
> +	    einfo (_("%P: warning: cannot find entry symbol %s;"
> +		     " not setting start address\n"),
> +		   entry_symbol.name);
> +	}

In which cases is this warning printed?

Thanks,
Florian

(sorry for any duplicates)



More information about the Binutils mailing list