From: Alan Modra Date: Tue, 27 Apr 2004 03:13:15 +0000 (+0000) Subject: * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1829f4b2af96932cb1c6aeca4815c7c5dd706f3d;p=binutils-gdb.git * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign structure field removed in 2004-04-24 patch. * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix. * elf-bfd.h (struct elf_backend_data ): Constify hdr arg. * elf32-arm.h (elf32_arm_section_flags): Likewise. * elf64-alpha.c (elf64_alpha_section_flags): Likewise. * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section field before calling elf_backend_section_flags. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 07643930a12..cb505e480e0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,17 @@ +2004-04-27 Alan Modra + + * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign + structure field removed in 2004-04-24 patch. + * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix. + + * elf-bfd.h (struct elf_backend_data ): + Constify hdr arg. + * elf32-arm.h (elf32_arm_section_flags): Likewise. + * elf64-alpha.c (elf64_alpha_section_flags): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise. + * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section + field before calling elf_backend_section_flags. + 2004-04-24 Chris Demetriou * elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16) diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index cfc42ac9a6b..4877a0a4686 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -597,7 +597,7 @@ struct elf_backend_data /* A function to convert machine dependent section header flags to BFD internal section header flags. */ bfd_boolean (*elf_backend_section_flags) - (flagword *, Elf_Internal_Shdr *); + (flagword *, const Elf_Internal_Shdr *); /* A function to handle unusual program segment types when creating BFD sections from ELF program segments. */ diff --git a/bfd/elf.c b/bfd/elf.c index d05a3df50c2..d383813e939 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -652,6 +652,9 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, if (newsect == NULL) return FALSE; + hdr->bfd_section = newsect; + elf_section_data (newsect)->this_hdr = *hdr; + /* Always use the real type/flags. */ elf_section_type (newsect) = hdr->sh_type; elf_section_flags (newsect) = hdr->sh_flags; @@ -798,9 +801,6 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, } } - hdr->bfd_section = newsect; - elf_section_data (newsect)->this_hdr = *hdr; - return TRUE; } diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index d6857d4a77a..64da33374f5 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -4121,7 +4121,7 @@ elf32_arm_reloc_type_class (rela) } } -static bfd_boolean elf32_arm_section_flags PARAMS ((flagword *, Elf_Internal_Shdr *)); +static bfd_boolean elf32_arm_section_flags PARAMS ((flagword *, const Elf_Internal_Shdr *)); static void elf32_arm_final_write_processing PARAMS ((bfd *, bfd_boolean)); /* Set the right machine number for an Arm ELF file. */ @@ -4129,7 +4129,7 @@ static void elf32_arm_final_write_processing PARAMS ((bfd *, bfd_boolean static bfd_boolean elf32_arm_section_flags (flags, hdr) flagword *flags; - Elf_Internal_Shdr *hdr; + const Elf_Internal_Shdr *hdr; { if (hdr->sh_type == SHT_NOTE) *flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 2d4715b4e14..01c66b5dcff 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -75,7 +75,7 @@ static bfd_boolean elf64_alpha_object_p static bfd_boolean elf64_alpha_section_from_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); static bfd_boolean elf64_alpha_section_flags - PARAMS ((flagword *, Elf_Internal_Shdr *)); + PARAMS ((flagword *, const Elf_Internal_Shdr *)); static bfd_boolean elf64_alpha_fake_sections PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); static bfd_boolean elf64_alpha_create_got_section @@ -2315,7 +2315,7 @@ elf64_alpha_section_from_shdr (abfd, hdr, name) static bfd_boolean elf64_alpha_section_flags (flags, hdr) flagword *flags; - Elf_Internal_Shdr *hdr; + const Elf_Internal_Shdr *hdr; { if (hdr->sh_flags & SHF_ALPHA_GPREL) *flags |= SEC_SMALL_DATA; @@ -2572,7 +2572,6 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) #undef READ debug->fdr = NULL; - debug->adjust = NULL; return TRUE; diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 886cb4d7ae0..905890e98a9 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -3112,7 +3112,7 @@ sparc64_elf_object_p (abfd) static bfd_vma sparc64_elf_plt_sym_val (bfd_vma i, const asection *plt, - const arelent *rel) + const arelent *rel ATTRIBUTE_UNUSED) { bfd_vma j; diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index b19aac2c55d..20d90831f12 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -186,7 +186,7 @@ static bfd_boolean is_unwind_section_name static bfd_boolean elfNN_ia64_section_from_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); static bfd_boolean elfNN_ia64_section_flags - PARAMS ((flagword *, Elf_Internal_Shdr *)); + PARAMS ((flagword *, const Elf_Internal_Shdr *)); static bfd_boolean elfNN_ia64_fake_sections PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)); static void elfNN_ia64_final_write_processing @@ -1271,7 +1271,7 @@ elfNN_ia64_section_from_shdr (abfd, hdr, name) static bfd_boolean elfNN_ia64_section_flags (flags, hdr) flagword *flags; - Elf_Internal_Shdr *hdr; + const Elf_Internal_Shdr *hdr; { if (hdr->sh_flags & SHF_IA_64_SHORT) *flags |= SEC_SMALL_DATA;