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]
Other format: [Raw text]

Re: [PATCH] R_390_RELATIVE bug fix for s390*.


On Thu, Nov 13, 2003 at 04:58:52PM +0100, Martin Schwidefsky wrote:
> --- src/bfd/elf32-s390.c	2003-11-11 17:56:57.000000000 +0100
> +++ src-s390/bfd/elf32-s390.c	2003-11-13 16:38:55.000000000 +0100
[snip]
> +		      if (h == NULL)
> +			sec = local_sections[r_symndx];
> +		      else
> +			{
> +			  BFD_ASSERT (h->root.type == bfd_link_hash_defined
> +				      || (h->root.type
> +					  == bfd_link_hash_defweak));
> +			  sec = h->root.u.def.section;
> +			}

Hi Martin,
  You probably developed this patch before my 2003-11-05 change to
_bfd_elf_rela_local_sym.  The above lines will replace the correct
value of sec returned by _bfd_eld_rela_local_sym with an incorrect
value in the case of SEC_MERGE sections.

> +		      if (sec != NULL && bfd_is_abs_section (sec))

sec != NULL test isn't needed.

[snip]
> +			{
> +			  asection *osec;
> +
> +			  osec = sec->output_section;
> +			  sindx = elf_section_data (osec)->dynindx;
> +			  BFD_ASSERT (sindx > 0);
> +			}
> +		      outrel.r_info = ELF32_R_INFO (sindx, r_type);
> +		      outrel.r_addend = relocation + rel->r_addend;

Are you sure you want to copy the IMO buggy ppc32 and sparc treatment of
dynamic relocs against local syms?  You'll need some changes to your
ld.so if you really want this.  See
http://sources.redhat.com/ml/binutils/2003-11/msg00069.html

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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