* 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.
This commit is contained in:
Ian Lance Taylor 1993-09-20 23:25:52 +00:00
parent 2a1bb52757
commit 36d541b1c7
2 changed files with 17 additions and 4 deletions

View 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

View 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;
}