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: relaxing vs section merging


> -----Original Message-----
> From: binutils-owner On Behalf Of Alan Modra
> Sent: 27 April 2004 04:28
> To: DJ Delorie

> On Mon, Apr 26, 2004 at 10:47:14PM -0400, DJ Delorie wrote:
> > 
> > Yeah, I added calls to _bfd_merged_section_offset (the mn10300
> > relocation code calls it indirectly).  That's when all the other
> > problems started happening; I think I mentioned that in my original
> > email.
> 
> Well, you mentioned _bfd_elf_rela_local_sym, but that's not what I
> meant.   I'm talking about code in elf-m10300.c that does
> 
> 	  isym = isymbuf + ELF32_R_SYM (irel->r_info);
> 	  if (isym->st_shndx == SHN_UNDEF)
> 	    sym_sec = bfd_und_section_ptr;
> 	  else if (isym->st_shndx == SHN_ABS)
> 	    sym_sec = bfd_abs_section_ptr;
> 	  else if (isym->st_shndx == SHN_COMMON)
> 	    sym_sec = bfd_com_section_ptr;
> 	  else
> 	    sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
> 
> 	  symval = (isym->st_value
> 		    + sym_sec->output_section->vma
> 		    + sym_sec->output_offset);
> 
> then uses symval.

  Hmmm.  Aren't you about to run into the discrepancy I stumbled across a
while ago in this clause:

> 	  if (isym->st_shndx == SHN_UNDEF)
> 	    sym_sec = bfd_und_section_ptr;

because SHN_UNDEF = 0, but also absolute relocs in ELF are indicated by
relocs against the absolute symbol, which has a st_shndx value of zero ?

[  See http://sources.redhat.com/ml/binutils/2004-03/msg00107.html and
preceding thread refs for more.  ]



    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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