Back to index

cell-binutils  2.17cvs20070401
Defines | Functions
libbfd.c File Reference
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"

Go to the source code of this file.

Defines

#define getpagesize()   2048
#define COERCE16(x)   (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)
 The do-it-yourself (byte) sex-change kit.
#define COERCE32(x)   (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)
#define EIGHT_GAZILLION   ((bfd_int64_t) 1 << 63)
#define COERCE64(x)   (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)

Functions

bfd_boolean bfd_false (bfd *ignore ATTRIBUTE_UNUSED)
bfd_boolean bfd_true (bfd *ignore ATTRIBUTE_UNUSED)
void * bfd_nullvoidptr (bfd *ignore ATTRIBUTE_UNUSED)
int bfd_0 (bfd *ignore ATTRIBUTE_UNUSED)
unsigned int bfd_0u (bfd *ignore ATTRIBUTE_UNUSED)
long bfd_0l (bfd *ignore ATTRIBUTE_UNUSED)
long _bfd_n1 (bfd *ignore_abfd ATTRIBUTE_UNUSED)
void bfd_void (bfd *ignore ATTRIBUTE_UNUSED)
long _bfd_norelocs_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, asection *sec ATTRIBUTE_UNUSED)
long _bfd_norelocs_canonicalize_reloc (bfd *abfd ATTRIBUTE_UNUSED, asection *sec ATTRIBUTE_UNUSED, arelent **relptr, asymbol **symbols ATTRIBUTE_UNUSED)
bfd_boolean _bfd_nocore_core_file_matches_executable_p (bfd *ignore_core_bfd ATTRIBUTE_UNUSED, bfd *ignore_exec_bfd ATTRIBUTE_UNUSED)
char * _bfd_nocore_core_file_failing_command (bfd *ignore_abfd ATTRIBUTE_UNUSED)
int _bfd_nocore_core_file_failing_signal (bfd *ignore_abfd ATTRIBUTE_UNUSED)
const bfd_target_bfd_dummy_target (bfd *ignore_abfd ATTRIBUTE_UNUSED)
void * bfd_malloc (bfd_size_type size)
void * bfd_malloc2 (bfd_size_type nmemb, bfd_size_type size)
void * bfd_realloc (void *ptr, bfd_size_type size)
void * bfd_realloc2 (void *ptr, bfd_size_type nmemb, bfd_size_type size)
void * bfd_zmalloc (bfd_size_type size)
void * bfd_zmalloc2 (bfd_size_type nmemb, bfd_size_type size)
bfd_boolean bfd_write_bigendian_4byte_int (bfd *abfd, unsigned int i)
bfd_vma bfd_getb16 (const void *p)
bfd_vma bfd_getl16 (const void *p)
bfd_signed_vma bfd_getb_signed_16 (const void *p)
bfd_signed_vma bfd_getl_signed_16 (const void *p)
void bfd_putb16 (bfd_vma data, void *p)
void bfd_putl16 (bfd_vma data, void *p)
bfd_vma bfd_getb32 (const void *p)
bfd_vma bfd_getl32 (const void *p)
bfd_signed_vma bfd_getb_signed_32 (const void *p)
bfd_signed_vma bfd_getl_signed_32 (const void *p)
bfd_uint64_t bfd_getb64 (const void *p ATTRIBUTE_UNUSED)
bfd_uint64_t bfd_getl64 (const void *p ATTRIBUTE_UNUSED)
bfd_int64_t bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED)
bfd_int64_t bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED)
void bfd_putb32 (bfd_vma data, void *p)
void bfd_putl32 (bfd_vma data, void *p)
void bfd_putb64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
void bfd_putl64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
void bfd_put_bits (bfd_uint64_t data, void *p, int bits, bfd_boolean big_p)
bfd_uint64_t bfd_get_bits (const void *p, int bits, bfd_boolean big_p)
bfd_boolean _bfd_generic_get_section_contents (bfd *abfd, sec_ptr section, void *location, file_ptr offset, bfd_size_type count)
bfd_boolean _bfd_generic_get_section_contents_in_window (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr section ATTRIBUTE_UNUSED, bfd_window *w ATTRIBUTE_UNUSED, file_ptr offset ATTRIBUTE_UNUSED, bfd_size_type count ATTRIBUTE_UNUSED)
bfd_boolean _bfd_generic_set_section_contents (bfd *abfd, sec_ptr section, const void *location, file_ptr offset, bfd_size_type count)
unsigned int bfd_log2 (bfd_vma x)
bfd_boolean bfd_generic_is_local_label_name (bfd *abfd, const char *name)
bfd_boolean _bfd_generic_verify_endian_match (bfd *ibfd, bfd *obfd)
void warn_deprecated (const char *what, const char *file, int line, const char *func)
bfd_vma read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf, unsigned int *bytes_read_ptr)
bfd_signed_vma read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf, unsigned int *bytes_read_ptr)
bfd_boolean _bfd_generic_find_line (bfd *abfd ATTRIBUTE_UNUSED, asymbol **symbols ATTRIBUTE_UNUSED, asymbol *symbol ATTRIBUTE_UNUSED, const char **filename_ptr ATTRIBUTE_UNUSED, unsigned int *linenumber_ptr ATTRIBUTE_UNUSED)
bfd_boolean _bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED, asection *isec ATTRIBUTE_UNUSED, bfd *obfd ATTRIBUTE_UNUSED, asection *osec ATTRIBUTE_UNUSED, struct bfd_link_info *link_info ATTRIBUTE_UNUSED)

Define Documentation

#define COERCE16 (   x)    (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)

The do-it-yourself (byte) sex-change kit.

Definition at line 514 of file libbfd.c.

#define COERCE32 (   x)    (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)

Definition at line 515 of file libbfd.c.

#define COERCE64 (   x)    (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)

Definition at line 517 of file libbfd.c.

#define EIGHT_GAZILLION   ((bfd_int64_t) 1 << 63)

Definition at line 516 of file libbfd.c.

#define getpagesize (   void)    2048

Definition at line 28 of file libbfd.c.


Function Documentation

const bfd_target* _bfd_dummy_target ( bfd *ignore_abfd  ATTRIBUTE_UNUSED)

Definition at line 153 of file libbfd.c.

Here is the call graph for this function:

bfd_boolean _bfd_generic_find_line ( bfd *abfd  ATTRIBUTE_UNUSED,
asymbol **symbols  ATTRIBUTE_UNUSED,
asymbol *symbol  ATTRIBUTE_UNUSED,
const char **filename_ptr  ATTRIBUTE_UNUSED,
unsigned int *linenumber_ptr  ATTRIBUTE_UNUSED 
)

Definition at line 1045 of file libbfd.c.

{
  return FALSE;
}
bfd_boolean _bfd_generic_get_section_contents ( bfd abfd,
sec_ptr  section,
void *  location,
file_ptr  offset,
bfd_size_type  count 
)

Definition at line 811 of file libbfd.c.

{
  bfd_size_type sz;
  if (count == 0)
    return TRUE;

  sz = section->rawsize ? section->rawsize : section->size;
  if (offset + count > sz)
    {
      bfd_set_error (bfd_error_invalid_operation);
      return FALSE;
    }

  if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
      || bfd_bread (location, count, abfd) != count)
    return FALSE;

  return TRUE;
}

Here is the call graph for this function:

bfd_boolean _bfd_generic_get_section_contents_in_window ( bfd *abfd  ATTRIBUTE_UNUSED,
sec_ptr section  ATTRIBUTE_UNUSED,
bfd_window *w  ATTRIBUTE_UNUSED,
file_ptr offset  ATTRIBUTE_UNUSED,
bfd_size_type count  ATTRIBUTE_UNUSED 
)

Definition at line 837 of file libbfd.c.

{
#ifdef USE_MMAP
  bfd_size_type sz;

  if (count == 0)
    return TRUE;
  if (abfd->xvec->_bfd_get_section_contents
      != _bfd_generic_get_section_contents)
    {
      /* We don't know what changes the bfd's get_section_contents
        method may have to make.  So punt trying to map the file
        window, and let get_section_contents do its thing.  */
      /* @@ FIXME : If the internal window has a refcount of 1 and was
        allocated with malloc instead of mmap, just reuse it.  */
      bfd_free_window (w);
      w->i = bfd_zmalloc (sizeof (bfd_window_internal));
      if (w->i == NULL)
       return FALSE;
      w->i->data = bfd_malloc (count);
      if (w->i->data == NULL)
       {
         free (w->i);
         w->i = NULL;
         return FALSE;
       }
      w->i->mapped = 0;
      w->i->refcount = 1;
      w->size = w->i->size = count;
      w->data = w->i->data;
      return bfd_get_section_contents (abfd, section, w->data, offset, count);
    }
  sz = section->rawsize ? section->rawsize : section->size;
  if (offset + count > sz
      || ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
                            TRUE))
    return FALSE;
  return TRUE;
#else
  abort ();
#endif
}

Here is the call graph for this function:

bfd_boolean _bfd_generic_init_private_section_data ( bfd *ibfd  ATTRIBUTE_UNUSED,
asection *isec  ATTRIBUTE_UNUSED,
bfd *obfd  ATTRIBUTE_UNUSED,
asection *osec  ATTRIBUTE_UNUSED,
struct bfd_link_info *link_info  ATTRIBUTE_UNUSED 
)

Definition at line 1055 of file libbfd.c.

{
  return TRUE;
}
bfd_boolean _bfd_generic_set_section_contents ( bfd abfd,
sec_ptr  section,
const void *  location,
file_ptr  offset,
bfd_size_type  count 
)

Definition at line 889 of file libbfd.c.

{
  if (count == 0)
    return TRUE;

  if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
      || bfd_bwrite (location, count, abfd) != count)
    return FALSE;

  return TRUE;
}

Here is the call graph for this function:

Definition at line 939 of file libbfd.c.

{
  if (ibfd->xvec->byteorder != obfd->xvec->byteorder
      && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
      && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
    {
      const char *msg;

      if (bfd_big_endian (ibfd))
       msg = _("%B: compiled for a big endian system and target is little endian");
      else
       msg = _("%B: compiled for a little endian system and target is big endian");

      (*_bfd_error_handler) (msg, ibfd);

      bfd_set_error (bfd_error_wrong_format);
      return FALSE;
    }

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

long _bfd_n1 ( bfd *ignore_abfd  ATTRIBUTE_UNUSED)

Definition at line 95 of file libbfd.c.

Here is the call graph for this function:

char* _bfd_nocore_core_file_failing_command ( bfd *ignore_abfd  ATTRIBUTE_UNUSED)

Definition at line 136 of file libbfd.c.

Here is the call graph for this function:

int _bfd_nocore_core_file_failing_signal ( bfd *ignore_abfd  ATTRIBUTE_UNUSED)

Definition at line 146 of file libbfd.c.

Here is the call graph for this function:

bfd_boolean _bfd_nocore_core_file_matches_executable_p ( bfd *ignore_core_bfd  ATTRIBUTE_UNUSED,
bfd *ignore_exec_bfd  ATTRIBUTE_UNUSED 
)

Definition at line 125 of file libbfd.c.

Here is the call graph for this function:

long _bfd_norelocs_canonicalize_reloc ( bfd *abfd  ATTRIBUTE_UNUSED,
asection *sec  ATTRIBUTE_UNUSED,
arelent **  relptr,
asymbol **symbols  ATTRIBUTE_UNUSED 
)

Definition at line 114 of file libbfd.c.

{
  *relptr = NULL;
  return 0;
}
long _bfd_norelocs_get_reloc_upper_bound ( bfd *abfd  ATTRIBUTE_UNUSED,
asection *sec  ATTRIBUTE_UNUSED 
)

Definition at line 107 of file libbfd.c.

{
  return sizeof (arelent *);
}
int bfd_0 ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 74 of file libbfd.c.

{
  return 0;
}
long bfd_0l ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 86 of file libbfd.c.

{
  return 0;
}
unsigned int bfd_0u ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 80 of file libbfd.c.

{
   return 0;
}
bfd_boolean bfd_false ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 48 of file libbfd.c.

Here is the call graph for this function:

bfd_boolean bfd_generic_is_local_label_name ( bfd abfd,
const char *  name 
)

Definition at line 928 of file libbfd.c.

{
  char locals_prefix = (bfd_get_symbol_leading_char (abfd) == '_') ? 'L' : '.';

  return name[0] == locals_prefix;
}
bfd_uint64_t bfd_get_bits ( const void *  p,
int  bits,
bfd_boolean  big_p 
)

Definition at line 786 of file libbfd.c.

{
  const bfd_byte *addr = p;
  bfd_uint64_t data;
  int i;
  int bytes;

  if (bits % 8 != 0)
    abort ();

  data = 0;
  bytes = bits / 8;
  for (i = 0; i < bytes; i++)
    {
      int index = big_p ? i : bytes - i - 1;

      data = (data << 8) | addr[index];
    }

  return data;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_vma bfd_getb16 ( const void *  p)

Definition at line 521 of file libbfd.c.

{
  const bfd_byte *addr = p;
  return (addr[0] << 8) | addr[1];
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_vma bfd_getb32 ( const void *  p)

Definition at line 565 of file libbfd.c.

{
  const bfd_byte *addr = p;
  unsigned long v;

  v = (unsigned long) addr[0] << 24;
  v |= (unsigned long) addr[1] << 16;
  v |= (unsigned long) addr[2] << 8;
  v |= (unsigned long) addr[3];
  return v;
}

Here is the call graph for this function:

bfd_uint64_t bfd_getb64 ( const void *p  ATTRIBUTE_UNUSED)

Definition at line 617 of file libbfd.c.

{
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  bfd_uint64_t v;

  v  = addr[0]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[2]; v <<= 8;
  v |= addr[3]; v <<= 8;
  v |= addr[4]; v <<= 8;
  v |= addr[5]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[7];

  return v;
#else
  BFD_FAIL();
  return 0;
#endif
}

Here is the call graph for this function:

Definition at line 535 of file libbfd.c.

{
  const bfd_byte *addr = p;
  return COERCE16 ((addr[0] << 8) | addr[1]);
}

Here is the call graph for this function:

Definition at line 591 of file libbfd.c.

{
  const bfd_byte *addr = p;
  unsigned long v;

  v = (unsigned long) addr[0] << 24;
  v |= (unsigned long) addr[1] << 16;
  v |= (unsigned long) addr[2] << 8;
  v |= (unsigned long) addr[3];
  return COERCE32 (v);
}

Here is the call graph for this function:

bfd_int64_t bfd_getb_signed_64 ( const void *p  ATTRIBUTE_UNUSED)

Definition at line 664 of file libbfd.c.

{
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  bfd_uint64_t v;

  v  = addr[0]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[2]; v <<= 8;
  v |= addr[3]; v <<= 8;
  v |= addr[4]; v <<= 8;
  v |= addr[5]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[7];

  return COERCE64 (v);
#else
  BFD_FAIL();
  return 0;
#endif
}

Here is the call graph for this function:

bfd_vma bfd_getl16 ( const void *  p)

Definition at line 528 of file libbfd.c.

{
  const bfd_byte *addr = p;
  return (addr[1] << 8) | addr[0];
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_vma bfd_getl32 ( const void *  p)

Definition at line 578 of file libbfd.c.

{
  const bfd_byte *addr = p;
  unsigned long v;

  v = (unsigned long) addr[0];
  v |= (unsigned long) addr[1] << 8;
  v |= (unsigned long) addr[2] << 16;
  v |= (unsigned long) addr[3] << 24;
  return v;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_uint64_t bfd_getl64 ( const void *p  ATTRIBUTE_UNUSED)

Definition at line 640 of file libbfd.c.

{
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  bfd_uint64_t v;

  v  = addr[7]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[5]; v <<= 8;
  v |= addr[4]; v <<= 8;
  v |= addr[3]; v <<= 8;
  v |= addr[2]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[0];

  return v;
#else
  BFD_FAIL();
  return 0;
#endif

}

Here is the call graph for this function:

Definition at line 542 of file libbfd.c.

{
  const bfd_byte *addr = p;
  return COERCE16 ((addr[1] << 8) | addr[0]);
}

Here is the call graph for this function:

Definition at line 604 of file libbfd.c.

{
  const bfd_byte *addr = p;
  unsigned long v;

  v = (unsigned long) addr[0];
  v |= (unsigned long) addr[1] << 8;
  v |= (unsigned long) addr[2] << 16;
  v |= (unsigned long) addr[3] << 24;
  return COERCE32 (v);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_int64_t bfd_getl_signed_64 ( const void *p  ATTRIBUTE_UNUSED)

Definition at line 687 of file libbfd.c.

{
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  bfd_uint64_t v;

  v  = addr[7]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[5]; v <<= 8;
  v |= addr[4]; v <<= 8;
  v |= addr[3]; v <<= 8;
  v |= addr[2]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[0];

  return COERCE64 (v);
#else
  BFD_FAIL();
  return 0;
#endif
}

Here is the call graph for this function:

Definition at line 918 of file libbfd.c.

{
  unsigned int result = 0;

  while ((x = (x >> 1)) != 0)
    ++result;
  return result;
}

Here is the caller graph for this function:

void* bfd_malloc ( bfd_size_type  size)

Definition at line 162 of file libbfd.c.

{
  void *ptr;

  if (size != (size_t) size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  ptr = malloc ((size_t) size);
  if (ptr == NULL && (size_t) size != 0)
    bfd_set_error (bfd_error_no_memory);

  return ptr;
}

Here is the call graph for this function:

void* bfd_malloc2 ( bfd_size_type  nmemb,
bfd_size_type  size 
)

Definition at line 182 of file libbfd.c.

{
  void *ptr;

  if ((nmemb | size) >= HALF_BFD_SIZE_TYPE
      && size != 0
      && nmemb > ~(bfd_size_type) 0 / size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  size *= nmemb;

  if (size != (size_t) size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  ptr = malloc ((size_t) size);
  if (ptr == NULL && (size_t) size != 0)
    bfd_set_error (bfd_error_no_memory);

  return ptr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* bfd_nullvoidptr ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 67 of file libbfd.c.

Here is the call graph for this function:

void bfd_put_bits ( bfd_uint64_t  data,
void *  p,
int  bits,
bfd_boolean  big_p 
)

Definition at line 766 of file libbfd.c.

{
  bfd_byte *addr = p;
  int i;
  int bytes;

  if (bits % 8 != 0)
    abort ();

  bytes = bits / 8;
  for (i = 0; i < bytes; i++)
    {
      int index = big_p ? bytes - i - 1 : i;

      addr[index] = data & 0xff;
      data >>= 8;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bfd_putb16 ( bfd_vma  data,
void *  p 
)

Definition at line 549 of file libbfd.c.

{
  bfd_byte *addr = p;
  addr[0] = (data >> 8) & 0xff;
  addr[1] = data & 0xff;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bfd_putb32 ( bfd_vma  data,
void *  p 
)

Definition at line 710 of file libbfd.c.

{
  bfd_byte *addr = p;
  addr[0] = (data >> 24) & 0xff;
  addr[1] = (data >> 16) & 0xff;
  addr[2] = (data >>  8) & 0xff;
  addr[3] = data & 0xff;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bfd_putb64 ( bfd_uint64_t data  ATTRIBUTE_UNUSED,
void *p  ATTRIBUTE_UNUSED 
)

Definition at line 730 of file libbfd.c.

{
#ifdef BFD_HOST_64_BIT
  bfd_byte *addr = p;
  addr[0] = (data >> (7*8)) & 0xff;
  addr[1] = (data >> (6*8)) & 0xff;
  addr[2] = (data >> (5*8)) & 0xff;
  addr[3] = (data >> (4*8)) & 0xff;
  addr[4] = (data >> (3*8)) & 0xff;
  addr[5] = (data >> (2*8)) & 0xff;
  addr[6] = (data >> (1*8)) & 0xff;
  addr[7] = (data >> (0*8)) & 0xff;
#else
  BFD_FAIL();
#endif
}

Here is the call graph for this function:

void bfd_putl16 ( bfd_vma  data,
void *  p 
)

Definition at line 557 of file libbfd.c.

{
  bfd_byte *addr = p;
  addr[0] = data & 0xff;
  addr[1] = (data >> 8) & 0xff;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bfd_putl32 ( bfd_vma  data,
void *  p 
)

Definition at line 720 of file libbfd.c.

{
  bfd_byte *addr = p;
  addr[0] = data & 0xff;
  addr[1] = (data >>  8) & 0xff;
  addr[2] = (data >> 16) & 0xff;
  addr[3] = (data >> 24) & 0xff;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bfd_putl64 ( bfd_uint64_t data  ATTRIBUTE_UNUSED,
void *p  ATTRIBUTE_UNUSED 
)

Definition at line 748 of file libbfd.c.

{
#ifdef BFD_HOST_64_BIT
  bfd_byte *addr = p;
  addr[7] = (data >> (7*8)) & 0xff;
  addr[6] = (data >> (6*8)) & 0xff;
  addr[5] = (data >> (5*8)) & 0xff;
  addr[4] = (data >> (4*8)) & 0xff;
  addr[3] = (data >> (3*8)) & 0xff;
  addr[2] = (data >> (2*8)) & 0xff;
  addr[1] = (data >> (1*8)) & 0xff;
  addr[0] = (data >> (0*8)) & 0xff;
#else
  BFD_FAIL();
#endif
}

Here is the call graph for this function:

void* bfd_realloc ( void *  ptr,
bfd_size_type  size 
)

Definition at line 212 of file libbfd.c.

{
  void *ret;

  if (size != (size_t) size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  if (ptr == NULL)
    ret = malloc ((size_t) size);
  else
    ret = realloc (ptr, (size_t) size);

  if (ret == NULL && (size_t) size != 0)
    bfd_set_error (bfd_error_no_memory);

  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* bfd_realloc2 ( void *  ptr,
bfd_size_type  nmemb,
bfd_size_type  size 
)

Definition at line 236 of file libbfd.c.

{
  void *ret;

  if ((nmemb | size) >= HALF_BFD_SIZE_TYPE
      && size != 0
      && nmemb > ~(bfd_size_type) 0 / size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  size *= nmemb;

  if (size != (size_t) size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  if (ptr == NULL)
    ret = malloc ((size_t) size);
  else
    ret = realloc (ptr, (size_t) size);

  if (ret == NULL && (size_t) size != 0)
    bfd_set_error (bfd_error_no_memory);

  return ret;
}

Here is the call graph for this function:

bfd_boolean bfd_true ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 58 of file libbfd.c.

{
  return TRUE;
}
void bfd_void ( bfd *ignore  ATTRIBUTE_UNUSED)

Definition at line 102 of file libbfd.c.

{
}

Definition at line 344 of file libbfd.c.

{
  bfd_byte buffer[4];
  bfd_putb32 ((bfd_vma) i, buffer);
  return bfd_bwrite (buffer, (bfd_size_type) 4, abfd) == 4;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* bfd_zmalloc ( bfd_size_type  size)

Definition at line 270 of file libbfd.c.

{
  void *ptr;

  if (size != (size_t) size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  ptr = malloc ((size_t) size);

  if ((size_t) size != 0)
    {
      if (ptr == NULL)
       bfd_set_error (bfd_error_no_memory);
      else
       memset (ptr, 0, (size_t) size);
    }

  return ptr;
}

Here is the call graph for this function:

void* bfd_zmalloc2 ( bfd_size_type  nmemb,
bfd_size_type  size 
)

Definition at line 297 of file libbfd.c.

{
  void *ptr;

  if ((nmemb | size) >= HALF_BFD_SIZE_TYPE
      && size != 0
      && nmemb > ~(bfd_size_type) 0 / size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  size *= nmemb;

  if (size != (size_t) size)
    {
      bfd_set_error (bfd_error_no_memory);
      return NULL;
    }

  ptr = malloc ((size_t) size);

  if ((size_t) size != 0)
    {
      if (ptr == NULL)
       bfd_set_error (bfd_error_no_memory);
      else
       memset (ptr, 0, (size_t) size);
    }

  return ptr;
}

Here is the call graph for this function:

bfd_signed_vma read_signed_leb128 ( bfd *abfd  ATTRIBUTE_UNUSED,
bfd_byte buf,
unsigned int bytes_read_ptr 
)

Definition at line 1017 of file libbfd.c.

{
  bfd_vma result;
  unsigned int shift;
  unsigned int num_read;
  unsigned char byte;

  result = 0;
  shift = 0;
  num_read = 0;
  do
    {
      byte = bfd_get_8 (abfd, buf);
      buf ++;
      num_read ++;
      result |= (((bfd_vma) byte & 0x7f) << shift);
      shift += 7;
    }
  while (byte & 0x80);
  if (shift < 8 * sizeof (result) && (byte & 0x40))
    result |= (((bfd_vma) -1) << shift);
  *bytes_read_ptr = num_read;
  return result;
}
bfd_vma read_unsigned_leb128 ( bfd *abfd  ATTRIBUTE_UNUSED,
bfd_byte buf,
unsigned int bytes_read_ptr 
)

Definition at line 989 of file libbfd.c.

{
  bfd_vma result;
  unsigned int num_read;
  unsigned int shift;
  unsigned char byte;

  result = 0;
  shift = 0;
  num_read = 0;
  do
    {
      byte = bfd_get_8 (abfd, buf);
      buf++;
      num_read++;
      result |= (((bfd_vma) byte & 0x7f) << shift);
      shift += 7;
    }
  while (byte & 0x80);
  *bytes_read_ptr = num_read;
  return result;
}
void warn_deprecated ( const char *  what,
const char *  file,
int  line,
const char *  func 
)

Definition at line 965 of file libbfd.c.

{
  /* Poor man's tracking of functions we've already warned about.  */
  static size_t mask = 0;

  if (~(size_t) func & ~mask)
    {
      /* Note: separate sentences in order to allow
        for translation into other languages.  */
      if (func)
       fprintf (stderr, _("Deprecated %s called at %s line %d in %s\n"),
               what, file, line, func);
      else
       fprintf (stderr, _("Deprecated %s called\n"), what);
      mask |= ~(size_t) func;
    }
}

Here is the call graph for this function: