X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fnlm32-i386.c;h=f16c74d985eb766bcf83b79c226ffe103ebc3572;hb=91d3970e7deae6622b5b13cdb5367c4bd91b706c;hp=0fc991cff459d5d2798302afcf6d12e8eddd17fc;hpb=e98fe4f7b54cbdf29aef9287bbb1bea8801dd05a;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/nlm32-i386.c b/bfd/nlm32-i386.c index 0fc991cff4..f16c74d985 100644 --- a/bfd/nlm32-i386.c +++ b/bfd/nlm32-i386.c @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -196,7 +196,7 @@ nlm_i386_write_import (abfd, sec, rel) else val -= nlm_get_data_low (abfd); - if (bfd_get_section (sym) != &bfd_und_section) + if (! bfd_is_und_section (bfd_get_section (sym))) { /* NetWare only supports absolute internal relocs. */ if (rel->howto->pc_relative) @@ -348,33 +348,29 @@ nlm_i386_read_import (abfd, sym) bfd_size_type rcount; /* number of relocs */ bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* temporary 32-bit value */ unsigned char symlength; /* length of symbol name */ + char *name; if (bfd_read ((PTR) &symlength, sizeof (symlength), 1, abfd) != sizeof (symlength)) return false; sym -> symbol.the_bfd = abfd; - sym -> symbol.name = bfd_alloc (abfd, symlength + 1); - if (!sym -> symbol.name) - { - bfd_set_error (bfd_error_no_memory); - return false; - } - if (bfd_read ((PTR) sym -> symbol.name, symlength, 1, abfd) - != symlength) + name = bfd_alloc (abfd, symlength + 1); + if (name == NULL) + return false; + if (bfd_read (name, symlength, 1, abfd) != symlength) return false; + name[symlength] = '\0'; + sym -> symbol.name = name; sym -> symbol.flags = 0; sym -> symbol.value = 0; - sym -> symbol.section = &bfd_und_section; + sym -> symbol.section = bfd_und_section_ptr; if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp)) return false; rcount = bfd_h_get_32 (abfd, temp); nlm_relocs = ((struct nlm_relent *) bfd_alloc (abfd, rcount * sizeof (struct nlm_relent))); if (!nlm_relocs) - { - bfd_set_error (bfd_error_no_memory); - return false; - } + return false; sym -> relocs = nlm_relocs; sym -> rcnt = 0; while (sym -> rcnt < rcount) @@ -401,7 +397,7 @@ nlm_i386_write_external (abfd, count, sym, relocs) asymbol *sym; struct reloc_and_sec *relocs; { - int i; + unsigned int i; bfd_byte len; unsigned char temp[NLM_TARGET_LONG_SIZE];