From: Ian Lance Taylor Date: Mon, 20 Sep 1993 23:25:52 +0000 (+0000) Subject: * elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=36d541b1c75637ae7b5eabac2d1b5be83ad2ff8b;p=binutils-gdb.git * elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a SHF_PROGBITS or SHT_STRTAB section if SEC_ALLOC is set. Never set SEC_DATA for a SHF_NOBITS section. * nlm32-i386.c (nlm_i386_mangle_relocs): Check SEC_LOAD rather than SEC_CODE | SEC_DATA. Add some casts to avoid warnings. * nlmcode.h: Add some casts to avoid warnings. (nlm_write_object_contents): Ignore relocs for sections that are neither code nor data. Just use the symbol value for debugging symbols; don't offset by the section vma. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bbf59b52806..b7999ccd3a9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,16 @@ +Mon Sep 20 19:18:10 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a + SHF_PROGBITS or SHT_STRTAB section if SEC_ALLOC is set. Never set + SEC_DATA for a SHF_NOBITS section. + + * nlm32-i386.c (nlm_i386_mangle_relocs): Check SEC_LOAD rather + than SEC_CODE | SEC_DATA. Add some casts to avoid warnings. + * nlmcode.h: Add some casts to avoid warnings. + (nlm_write_object_contents): Ignore relocs for sections that are + neither code nor data. Just use the symbol value for debugging + symbols; don't offset by the section vma. + Fri Sep 17 18:08:55 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * reloc.c (bfd_perform_relocation): Don't return an error when diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 96d11819009..1e234e2daa5 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -482,7 +482,7 @@ DEFUN (bfd_section_from_shdr, (abfd, shindex), if (hdr->sh_flags & SHF_EXECINSTR) newsect->flags |= SEC_CODE; /* FIXME: may only contain SOME code */ - else + else if (newsect->flags & SEC_ALLOC) newsect->flags |= SEC_DATA; hdr->rawdata = (void *) newsect; @@ -509,10 +509,10 @@ DEFUN (bfd_section_from_shdr, (abfd, shindex), if (!(hdr->sh_flags & SHF_WRITE)) newsect->flags |= SEC_READONLY; + /* FIXME: This section is empty. Does it really make + sense to set SEC_CODE for it? */ if (hdr->sh_flags & SHF_EXECINSTR) newsect->flags |= SEC_CODE; /* FIXME: may only contain SOME code */ - else - newsect->flags |= SEC_DATA; hdr->rawdata = (void *) newsect; } @@ -586,7 +586,7 @@ DEFUN (bfd_section_from_shdr, (abfd, shindex), newsect->flags |= SEC_READONLY; if (hdr->sh_flags & SHF_EXECINSTR) newsect->flags |= SEC_CODE; - else + else if (newsect->flags & SEC_ALLOC) newsect->flags |= SEC_DATA; }