Define __start/__stop symbols when there is only a dynamic def

Alan Modra amodra@gmail.com
Tue Jan 30 01:17:00 GMT 2018


On Mon, Jan 29, 2018 at 04:39:15PM -0800, H.J. Lu wrote:
> +extern int __start___verbose[];
> +extern int __stop___verbose[];
> +int
> +foo3 (void)
> +{
> +  if (__start___verbose == __stop___verbose
> +      || __start___verbose[0] != 6)
> +    return -1;
> +  else
> +    return 0;
> +}
> 
> Which __start___verbose/_start___verbose definition should it
> reference at run-time? There are more than one.

They should be resolved as for any other symbol in an ELF shared
library.  The test is verifying that we don't resolve to
__start/__stop symbols in another shared library's __verbose section
if there is a __verbose section in the executable.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list