* elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a
authorIan Lance Taylor <ian@airs.com>
Mon, 20 Sep 1993 23:25:52 +0000 (23:25 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 20 Sep 1993 23:25:52 +0000 (23:25 +0000)
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.

bfd/ChangeLog
bfd/elfcode.h

index bbf59b52806e55ff6eb7f5215d7c48726cb1c73b..b7999ccd3a915b8fa1c4a9ba2952f1307aa987ed 100644 (file)
@@ -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
index 96d11819009750206eb43e8003df7961fbce8594..1e234e2daa527b992c3a791156eb03644149a839 100644 (file)
@@ -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;
        }