[ccan] Bad section names make ld unhappy...

Rusty Russell rusty at rustcorp.com.au
Wed Mar 20 11:26:01 EST 2013


Alan Modra <amodra at gmail.com> writes:
> Fix attached.

Thanks!

Is there anything I should do from here, or should I just wait for the
goodness to flow into the next bfd release?

Thanks,
Rusty.

> -- 
> Alan Modra
> Australia Development Lab, IBM
> 	* elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
> 	sh_type by given is_rela.
>
> --- cygnus-virgin/bfd/elflink.c	2013-02-22 13:34:19.504693380 +1030
> +++ cygnus/bfd/elflink.c	2013-03-19 11:14:30.915876040 +1030
> @@ -13025,6 +13025,11 @@ _bfd_elf_make_dynamic_reloc_section (ase
>  	  reloc_sec = bfd_make_section_anyway_with_flags (dynobj, name, flags);
>  	  if (reloc_sec != NULL)
>  	    {
> +	      /* _bfd_elf_get_sec_type_attr chooses a section type by
> +		 name.  Override as it may be wrong, eg. for a user
> +		 section named "auto" we'll get ".relauto" which is
> +		 seen to be a .rela section.  */
> +	      elf_section_type (reloc_sec) = is_rela ? SHT_RELA : SHT_REL;
>  	      if (! bfd_set_section_alignment (dynobj, reloc_sec, alignment))
>  		reloc_sec = NULL;
>  	    }


More information about the ccan mailing list