This is the mail archive of the binutils@sources.redhat.com 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]

Re: RFC: .gnu.strtab (aka merging duplicate strings by ld)


Jakub Jelinek <jakub@redhat.com> writes:

> --- bfd/elf32-i386.c.jj	Mon Mar 26 19:44:20 2001
> +++ bfd/elf32-i386.c	Wed Mar 28 18:37:27 2001
> @@ -1392,9 +1392,16 @@ elf_i386_relocate_section (output_bfd, i
>  	{
>  	  sym = local_syms + r_symndx;
>  	  sec = local_sections[r_symndx];
> -	  relocation = (sec->output_section->vma
> -			+ sec->output_offset
> -			+ sym->st_value);
> +	  if (elf_section_data (sec) && elf_section_data (sec)->strtab_info)
> +	    relocation =
> +	      _bfd_gnu_strtab_section_offset
> +		(output_bfd, sec, elf_section_data (sec)->strtab_info,
> +		 sym->st_value, bfd_get_32 (input_bfd,
> +					    contents + rel->r_offset));
> +	  else
> +	    relocation = (sec->output_section->vma
> +			  + sec->output_offset
> +			  + sym->st_value);
>  	}
>        else
>  	{

An implementation which requires changing every ELF backend file is
clearly problematical.  Is it required?  Can you simply adjust the
symbol values in elf_link_input_bfd?

> +  if (tab->alignment_power)
> +    pad = alloca (1 << tab->alignment_power);

It used to be the case that code in BFD was not permitted to call
alloca.  Perhaps that restrictions has been lifted.

Ian


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