+2021-04-06 Jan Beulich <jbeulich@suse.com>
+
+ * pe-dll.c (generate_reloc): Bail immediately when .reloc is
+ being discarded. Warn when relocated entry is above .reloc.
+
2021-04-05 Alan Modra <amodra@gmail.com>
* configure.ac: Move initfini-array arg handling earlier. Don't
bfd *b;
struct bfd_section *s;
- if (reloc_s == NULL)
+ if (reloc_s == NULL || reloc_s->output_section == bfd_abs_section_ptr)
return;
total_relocs = 0;
for (b = info->input_bfds; b; b = b->link.next)
reloc_data[total_relocs].vma = sec_vma + relocs[i]->address;
reloc_data[total_relocs].idx = total_relocs;
+ /* Since we're only about to determine .reloc's size,
+ subsequent output section VMA calculations will shift up
+ sections at this or higher addresses. Relocations for
+ such sections would hence end up not being correct. */
+ if (reloc_data[total_relocs].vma
+ >= reloc_s->output_section->vma)
+ einfo (_("%P: base relocation for section `%s' above "
+ ".reloc section\n"), s->output_section->name);
+
#define BITS_AND_SHIFT(bits, shift) (bits * 1000 | shift)
switch BITS_AND_SHIFT (relocs[i]->howto->bitsize,