aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 70ed765..0009ee8 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2778,14 +2778,17 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
asection *s;
unsigned int idx;
- loc -= 4;
s = elt;
- if (!gas)
- s = s->output_section;
- idx = 0;
- if (s != NULL)
- idx = elf_section_data (s)->this_idx;
- H_PUT_32 (abfd, idx, loc);
+ if (! elf_discarded_section (s))
+ {
+ loc -= 4;
+ if (!gas)
+ s = s->output_section;
+ idx = 0;
+ if (s != NULL)
+ idx = elf_section_data (s)->this_idx;
+ H_PUT_32 (abfd, idx, loc);
+ }
elt = elf_next_in_group (elt);
if (elt == first)
break;