aboutsummaryrefslogtreecommitdiff
path: root/bfd/merge.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-05-22 01:56:31 +0000
committerAlan Modra <amodra@gmail.com>2004-05-22 01:56:31 +0000
commit753731eef094e983fab58faf7c7c5e8090de6e1b (patch)
treefbb781352bd805dad317c126df1f62b7f5188e2a /bfd/merge.c
parenta55491f7c4c7f716fcad92b8ad0acd4f757bc218 (diff)
downloadgdb-753731eef094e983fab58faf7c7c5e8090de6e1b.zip
gdb-753731eef094e983fab58faf7c7c5e8090de6e1b.tar.gz
gdb-753731eef094e983fab58faf7c7c5e8090de6e1b.tar.bz2
* 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 89f45cd..3811523 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;