+2000-10-05 Jim Wilson <wilson@cygnus.com>
+
+ * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags
+ field.
+ * elf.c (_bfd_elf_make_section_from_shdr): Call the
+ elf_backend_section_flags function.
+ * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion
+ code.
+ (elf64_ia64_section_flags): New function containing flag conversion
+ code.
+ (elf_backend_section_flags): Define to elf64_ia64_section_flags.
+ * elfxx-target.h (elf_backend_section_flags): Define.
+ (elfNN_bed): Initialize elf_backend_section_flags field.
+
2000-10-02 Alan Modra <alan@linuxcare.com.au>
* elf32-hppa.c (elf32_hppa_check_relocs): Correct call to
Elf32_Internal_Shdr *,
char *));
+ /* A function to convert machine dependent section header flags to
+ BFD internal section header flags. */
+ boolean (*elf_backend_section_flags) PARAMS ((flagword *,
+ Elf32_Internal_Shdr *));
+
/* A function to handle unusual program segment types when creating BFD
sections from ELF program segments. */
boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *,
{
asection *newsect;
flagword flags;
+ struct elf_backend_data *bed;
if (hdr->bfd_section != NULL)
{
if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0)
flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
+ bed = get_elf_backend_data (abfd);
+ if (bed->elf_backend_section_flags)
+ if (! bed->elf_backend_section_flags (&flags, hdr))
+ return false;
+
if (! bfd_set_section_flags (abfd, newsect, flags))
return false;
return false;
newsect = hdr->bfd_section;
+ return true;
+}
+
+/* Convert IA-64 specific section flags to bfd internal section flags. */
+
+/* ??? There is no bfd internal flag equivalent to the SHF_IA_64_NORECOV
+ flag. */
+
+static boolean
+elf64_ia64_section_flags (flags, hdr)
+ flagword *flags;
+ Elf64_Internal_Shdr *hdr;
+{
if (hdr->sh_flags & SHF_IA_64_SHORT)
- newsect->flags |= SEC_SMALL_DATA;
+ *flags |= SEC_SMALL_DATA;
return true;
}
#define elf_backend_section_from_shdr \
elf64_ia64_section_from_shdr
+#define elf_backend_section_flags \
+ elf64_ia64_section_flags
#define elf_backend_fake_sections \
elf64_ia64_fake_sections
#define elf_backend_add_symbol_hook \
#ifndef elf_backend_section_from_shdr
#define elf_backend_section_from_shdr 0
#endif
+#ifndef elf_backend_section_flags
+#define elf_backend_section_flags 0
+#endif
#ifndef elf_backend_section_from_phdr
#define elf_backend_section_from_phdr 0
#endif
elf_backend_get_symbol_type,
elf_backend_section_processing,
elf_backend_section_from_shdr,
+ elf_backend_section_flags,
elf_backend_section_from_phdr,
elf_backend_fake_sections,
elf_backend_section_from_bfd_section,