aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 5af924c..a016d47 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2408,10 +2408,11 @@ extern asection _bfd_elf_large_com_section;
link, we remove such relocations. Otherwise, we just want the
section contents zeroed and avoid any special processing. */
#define RELOC_AGAINST_DISCARDED_SECTION(info, input_bfd, input_section, \
- rel, relend, howto, contents) \
+ rel, count, relend, \
+ howto, index, contents) \
{ \
_bfd_clear_contents (howto, input_bfd, input_section, \
- contents + rel->r_offset); \
+ contents + rel[index].r_offset); \
\
if (info->relocatable \
&& (input_section->flags & SEC_DEBUGGING)) \
@@ -2423,23 +2424,28 @@ extern asection _bfd_elf_large_com_section;
rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); \
\
/* Avoid empty output section. */ \
- if (rel_hdr->sh_size > rel_hdr->sh_entsize) \
+ if (rel_hdr->sh_size > count * rel_hdr->sh_entsize) \
{ \
- rel_hdr->sh_size -= rel_hdr->sh_entsize; \
+ rel_hdr->sh_size -= count * rel_hdr->sh_entsize; \
rel_hdr = _bfd_elf_single_rel_hdr (input_section); \
- rel_hdr->sh_size -= rel_hdr->sh_entsize; \
+ rel_hdr->sh_size -= count * rel_hdr->sh_entsize; \
\
- memmove (rel, rel + 1, (relend - rel - 1) * sizeof (*rel)); \
+ memmove (rel, rel + count, \
+ (relend - rel - count) * sizeof (*rel)); \
\
- input_section->reloc_count--; \
- relend--; \
+ input_section->reloc_count -= count; \
+ relend -= count; \
rel--; \
continue; \
} \
} \
\
- rel->r_info = 0; \
- rel->r_addend = 0; \
+ for (i = 0; i < count; i++) \
+ { \
+ rel[i].r_info = 0; \
+ rel[i].r_addend = 0; \
+ } \
+ rel += count - 1; \
continue; \
}