aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-09-20 23:25:52 +0000
committerIan Lance Taylor <ian@airs.com>1993-09-20 23:25:52 +0000
commit36d541b1c75637ae7b5eabac2d1b5be83ad2ff8b (patch)
tree9233ec5e934c4e0630f1caaf5e6a4e6221df5909
parent2a1bb527575747317184f9641a4c278a78f70714 (diff)
downloadfsf-binutils-gdb-36d541b1c75637ae7b5eabac2d1b5be83ad2ff8b.zip
fsf-binutils-gdb-36d541b1c75637ae7b5eabac2d1b5be83ad2ff8b.tar.gz
fsf-binutils-gdb-36d541b1c75637ae7b5eabac2d1b5be83ad2ff8b.tar.bz2
* 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.
-rw-r--r--bfd/ChangeLog13
-rw-r--r--bfd/elfcode.h8
2 files changed, 17 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bbf59b5..b7999cc 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 96d1181..1e234e2 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;
}