This is the mail archive of the binutils@sourceware.org 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: [PATCH] tile: Remove the __tls_get_addr check from gc_mark_hook


On Tue, Oct 17, 2017 at 06:20:27PM -0700, H.J. Lu wrote:
> TLS_GD_CALL relocations implicitly reference __tls_get_addr.  Since
> elf_gc_mark_hook is called before check_relocs now, we need to call
> _bfd_generic_link_add_one_symbol to mark __tls_get_addr for garbage
> collection.
> 
> 	* elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
> 	_bfd_generic_link_add_one_symbol to mark __tls_get_addr.
> 	* elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.

OK, but

>  	case R_TILEPRO_TLS_GD_CALL:
> -	  /* This reloc implicitly references __tls_get_addr.  We know
> -	     another reloc will reference the same symbol as the one
> -	     on this reloc, so the real symbol and section will be
> -	     gc marked when processing the other reloc.  That lets
> -	     us handle __tls_get_addr here.  */
> -	  h = elf_link_hash_lookup (elf_hash_table (info), "__tls_get_addr",
> -				    FALSE, FALSE, TRUE);
> +	  /* This reloc implicitly references __tls_get_addr.  This
> +	     function is called before check_relocs.  Mark it for
> +	     garbage collection here.  */

please leave the existing comment unchanged rather than adding this
new comment.  Ditto for tilegx.  The old comment saying why it is
reasonable to not process the actual reloc symbol is useful.

-- 
Alan Modra
Australia Development Lab, IBM


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