projects
/
external
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
53022e4
)
* elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
author
DJ Delorie
<dj@redhat.com>
Fri, 3 Mar 2006 03:13:49 +0000
(
03:13
+0000)
committer
DJ Delorie
<dj@redhat.com>
Fri, 3 Mar 2006 03:13:49 +0000
(
03:13
+0000)
calculations.
bfd/ChangeLog
patch
|
blob
|
history
bfd/elf32-m32c.c
patch
|
blob
|
history
diff --git
a/bfd/ChangeLog
b/bfd/ChangeLog
index
1797c84
..
f7bb941
100644
(file)
--- a/
bfd/ChangeLog
+++ b/
bfd/ChangeLog
@@
-1,3
+1,8
@@
+2006-03-02 DJ Delorie <dj@redhat.com>
+
+ * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
+ calculations.
+
2006-03-02 Richard Sandiford <richard@codesourcery.com>
* elf32-ppc.c (is_ppc_elf_target): Return true if the target is
2006-03-02 Richard Sandiford <richard@codesourcery.com>
* elf32-ppc.c (is_ppc_elf_target): Return true if the target is
diff --git
a/bfd/elf32-m32c.c
b/bfd/elf32-m32c.c
index
2295a54
..
f56efd2
100644
(file)
--- a/
bfd/elf32-m32c.c
+++ b/
bfd/elf32-m32c.c
@@
-493,14
+493,15
@@
m32c_elf_relocate_section
}
#if 0
}
#if 0
- printf("relocate %s at %06lx relocation %06lx addend %ld ",
- m32c_elf_howto_table[ELF32_R_TYPE(rel->r_info)].name,
- rel->r_offset, relocation, rel->r_addend);
+ printf ("relocate %s at %06lx relocation %06lx addend %ld ",
+ m32c_elf_howto_table[ELF32_R_TYPE(rel->r_info)].name,
+ rel->r_offset + input_section->output_section->vma + input_section->output_offset,
+ relocation, rel->r_addend);
{
int i;
for (i=0; i<4; i++)
{
int i;
for (i=0; i<4; i++)
- printf(" %02x", contents[rel->r_offset+i]);
- printf("\n");
+ printf
(" %02x", contents[rel->r_offset+i]);
+ printf
("\n");
}
#endif
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
}
#endif
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
@@
-1219,10
+1220,9
@@
compare_reloc (const void *e1, const void *e2)
return i1->r_offset < i2->r_offset ? -1 : 1;
}
return i1->r_offset < i2->r_offset ? -1 : 1;
}
-#define OFFSET_FOR_RELOC(rel) m32c_offset_for_reloc (abfd,
sec,
rel, symtab_hdr, shndx_buf, intsyms)
+#define OFFSET_FOR_RELOC(rel) m32c_offset_for_reloc (abfd, rel, symtab_hdr, shndx_buf, intsyms)
static bfd_vma
m32c_offset_for_reloc (bfd *abfd,
static bfd_vma
m32c_offset_for_reloc (bfd *abfd,
- asection * sec,
Elf_Internal_Rela *rel,
Elf_Internal_Shdr *symtab_hdr,
Elf_External_Sym_Shndx *shndx_buf,
Elf_Internal_Rela *rel,
Elf_Internal_Shdr *symtab_hdr,
Elf_External_Sym_Shndx *shndx_buf,
@@
-1236,13
+1236,17
@@
m32c_offset_for_reloc (bfd *abfd,
/* A local symbol. */
Elf_Internal_Sym *isym;
Elf_External_Sym_Shndx *shndx;
/* A local symbol. */
Elf_Internal_Sym *isym;
Elf_External_Sym_Shndx *shndx;
+ asection *ssec;
+
isym = intsyms + ELF32_R_SYM (rel->r_info);
isym = intsyms + ELF32_R_SYM (rel->r_info);
+ ssec = bfd_section_from_elf_index (abfd, isym->st_shndx);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (rel->r_info) : 0);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (rel->r_info) : 0);
- symval = (isym->st_value
- + sec->output_section->vma
- + sec->output_offset);
+ symval = isym->st_value;
+ if (ssec)
+ symval += ssec->output_section->vma
+ + ssec->output_offset;
}
else
{
}
else
{