summaryrefslogtreecommitdiff
path: root/bfd/merge.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-05-22 01:56:31 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-05-22 01:56:31 +0000
commit49494152ae771709d7d86d3917b6ce67d768c6fb (patch)
tree8a0d3d33a17fbe00537e7b68c321633f4da9cd18 /bfd/merge.c
parentb67627ba7553d9e453103274b690e2df8e13a73c (diff)
downloadgdb-49494152ae771709d7d86d3917b6ce67d768c6fb.tar.gz
* merge.c (_bfd_merged_section_offset): Remove "addend" param.
* libbfd-in.h (_bfd_merged_section_offset): Adjust prototype. * libbfd.h: Regenerate. * elf.c (_bfd_elf_rela_local_sym): Adjust call. (_bfd_elf_rel_local_sym): Likewise. * elflink.c (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_input_bfd): Likewise. * elf32-ppc.c (ppc_elf_relax_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. (elfNN_ia64_relocate_section): Likewise.
Diffstat (limited to 'bfd/merge.c')
-rw-r--r--bfd/merge.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/bfd/merge.c b/bfd/merge.c
index 89f45cd521a..3811523ecc9 100644
--- a/bfd/merge.c
+++ b/bfd/merge.c
@@ -780,7 +780,7 @@ _bfd_write_merged_section (bfd *output_bfd, asection *sec, void *psecinfo)
bfd_vma
_bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
- void *psecinfo, bfd_vma offset, bfd_vma addend)
+ void *psecinfo, bfd_vma offset)
{
struct sec_merge_sec_info *secinfo;
struct sec_merge_hash_entry *entry;
@@ -789,13 +789,13 @@ _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
secinfo = (struct sec_merge_sec_info *) psecinfo;
- if (offset + addend >= sec->_raw_size)
+ if (offset >= sec->_raw_size)
{
- if (offset + addend > sec->_raw_size)
+ if (offset > sec->_raw_size)
{
(*_bfd_error_handler)
- (_("%s: access beyond end of merged section (%ld + %ld)"),
- bfd_get_filename (sec->owner), (long) offset, (long) addend);
+ (_("%s: access beyond end of merged section (%ld)"),
+ bfd_get_filename (sec->owner), (long) offset);
}
return (secinfo->first ? sec->_cooked_size : 0);
}
@@ -804,15 +804,14 @@ _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
{
if (sec->entsize == 1)
{
- p = secinfo->contents + offset + addend - 1;
+ p = secinfo->contents + offset - 1;
while (p >= secinfo->contents && *p)
--p;
++p;
}
else
{
- p = secinfo->contents
- + ((offset + addend) / sec->entsize) * sec->entsize;
+ p = secinfo->contents + (offset / sec->entsize) * sec->entsize;
p -= sec->entsize;
while (p >= secinfo->contents)
{
@@ -830,8 +829,7 @@ _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
}
else
{
- p = secinfo->contents
- + ((offset + addend) / sec->entsize) * sec->entsize;
+ p = secinfo->contents + (offset / sec->entsize) * sec->entsize;
}
entry = sec_merge_hash_lookup (secinfo->htab, p, 0, FALSE);
if (!entry)
@@ -845,9 +843,8 @@ _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
if (! secinfo->htab->first)
abort ();
entry = secinfo->htab->first;
- p = secinfo->contents
- + ((offset + addend) / sec->entsize + 1) * sec->entsize
- - entry->len;
+ p = (secinfo->contents + (offset / sec->entsize + 1) * sec->entsize
+ - entry->len);
}
*psec = entry->secinfo->sec;