/* Support for 32-bit PowerPC NLM (NetWare Loadable Module)
- Copyright (C) 1994 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
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"
name = NLM_CODE_NAME;
val &=~ NLM_HIBIT;
}
- *secp = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
+ *secp = bfd_get_section_by_name (abfd, name);
if (sym == NULL)
{
static boolean
nlm_powerpc_mangle_relocs (abfd, sec, data, offset, count)
- bfd *abfd;
- asection *sec;
- PTR data;
- bfd_vma offset;
- bfd_size_type count;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ bfd_vma offset ATTRIBUTE_UNUSED;
+ bfd_size_type count ATTRIBUTE_UNUSED;
{
return true;
}
sym -> symbol.the_bfd = abfd;
name = bfd_alloc (abfd, symlength + 1);
if (name == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ 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 == (struct nlm_relent *) NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return false;
- }
+ return false;
sym -> relocs = nlm_relocs;
sym -> rcnt = 0;
while (sym -> rcnt < rcount)
val |= NLM_HIBIT;
}
- if (bfd_get_section (sym) != &bfd_und_section)
+ if (! bfd_is_und_section (bfd_get_section (sym)))
{
/* This is an internal relocation fixup. The second most
significant bit is 0 if this is a reloc against the data
unsigned long l_symndx;
int l_rtype;
int l_rsecnm;
- const reloc_howto_type *howto;
+ reloc_howto_type *howto;
bfd_size_type address;
/* Get the sections now, for convenience. */
symsec = bfd_get_section (sym);
if (indx != -1)
{
- BFD_ASSERT (symsec == &bfd_und_section);
+ BFD_ASSERT (bfd_is_und_section (symsec));
l_symndx = indx + 3;
}
else
asymbol *sym;
struct reloc_and_sec *relocs;
{
- int i;
+ unsigned int i;
bfd_byte len;
unsigned char temp[NLM_TARGET_LONG_SIZE];
#ifdef OLDFORMAT