/* Which .reloc section? */
asection *srel;
- /* What kind of relocation? */
- unsigned int rtype;
-
- /* Is this against read-only section? */
- unsigned int reltext : 1;
+ /* Which section this relocation is against? */
+ asection *sec;
/* How many did we find? */
unsigned long count;
+
+ /* What kind of relocation? */
+ unsigned int rtype;
};
struct alpha_elf_link_hash_entry
\f
/* Handle an Alpha specific section when reading an object file. This
is called when bfd_section_from_shdr finds a section with an unknown
- type.
- FIXME: We need to handle the SHF_ALPHA_GPREL flag, but I'm not sure
- how to. */
+ type. */
static bfd_boolean
elf64_alpha_section_from_shdr (bfd *abfd,
/* Convert Alpha specific section flags to bfd internal section flags. */
static bfd_boolean
-elf64_alpha_section_flags (flagword *flags, const Elf_Internal_Shdr *hdr)
+elf64_alpha_section_flags (const Elf_Internal_Shdr *hdr)
{
if (hdr->sh_flags & SHF_ALPHA_GPREL)
- *flags |= SEC_SMALL_DATA;
+ hdr->bfd_section->flags |= SEC_SMALL_DATA;
return TRUE;
}
bfd_set_error (bfd_error_file_too_big); \
goto error_return; \
} \
- debug->ptr = (type) bfd_malloc (amt); \
- if (debug->ptr == NULL) \
+ if (bfd_seek (abfd, symhdr->offset, SEEK_SET) != 0) \
goto error_return; \
- if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \
- || bfd_bread (debug->ptr, amt, abfd) != amt) \
+ debug->ptr = (type) _bfd_malloc_and_read (abfd, amt, amt); \
+ if (debug->ptr == NULL) \
goto error_return; \
} while (0)
return FALSE;
rent->srel = sreloc;
+ rent->sec = sec;
rent->rtype = r_type;
rent->count = 1;
- rent->reltext = (sec->flags & SEC_READONLY) != 0;
rent->next = h->reloc_entries;
h->reloc_entries = rent;
loaded into memory, we need a RELATIVE reloc. */
sreloc->size += sizeof (Elf64_External_Rela);
if (sec->flags & SEC_READONLY)
- info->flags |= DF_TEXTREL;
+ {
+ info->flags |= DF_TEXTREL;
+ info->callbacks->minfo
+ (_("%pB: dynamic relocation against `%pT' in "
+ "read-only section `%pA'\n"),
+ sec->owner, h->root.root.root.string, sec);
+ }
}
}
}
bfd_link_pie (info));
if (entries)
{
+ asection *sec = relent->sec;
relent->srel->size +=
entries * sizeof (Elf64_External_Rela) * relent->count;
- if (relent->reltext)
- info->flags |= DT_TEXTREL;
+ if ((sec->flags & SEC_READONLY) != 0)
+ {
+ info->flags |= DT_TEXTREL;
+ info->callbacks->minfo
+ (_("%pB: dynamic relocation against `%pT' in "
+ "read-only section `%pA'\n"),
+ sec->owner, h->root.root.root.string, sec);
+ }
}
}
#define elf_backend_special_sections \
elf64_alpha_special_sections
+#define elf_backend_strip_zero_sized_dynamic_sections \
+ _bfd_elf_strip_zero_sized_dynamic_sections
+
/* A few constants that determine how the .plt section is set up. */
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0