~ubuntu-branches/ubuntu/hoary/binutils/hoary

« back to all changes in this revision

Viewing changes to bfd/pdp11.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-03-18 13:07:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050318130752-j4i37zgqclj53b94
Tags: 2.15-5ubuntu2
debian/rules: Call pkgstriptranslations if present (the package does not
use debhelper, thus it does not happen automatically).

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd));
135
135
#define MY_text_includes_header 1
136
136
 
137
 
bfd_vma         bfd_getp32         PARAMS ((const bfd_byte *));
138
 
bfd_signed_vma  bfd_getp_signed_32 PARAMS ((const bfd_byte *));
139
 
void            bfd_putp32         PARAMS ((bfd_vma, bfd_byte *));
 
137
static bfd_vma bfd_getp32 (const void *);
 
138
static bfd_signed_vma bfd_getp_signed_32 (const void *);
 
139
static void bfd_putp32 (bfd_vma, void *);
140
140
 
141
141
#define MY_BFD_TARGET
142
142
 
1429
1429
NAME(aout,set_section_contents) (abfd, section, location, offset, count)
1430
1430
     bfd *abfd;
1431
1431
     sec_ptr section;
1432
 
     PTR location;
 
1432
     const PTR location;
1433
1433
     file_ptr offset;
1434
1434
     bfd_size_type count;
1435
1435
{
2469
2469
    }
2470
2470
}
2471
2471
 
2472
 
/*ARGSUSED*/
2473
2472
void
2474
2473
NAME(aout,print_symbol) (abfd, afile, symbol, how)
2475
2474
     bfd * abfd;
5005
5004
}
5006
5005
/* end of modified aoutx.h */
5007
5006
 
5008
 
bfd_vma
5009
 
bfd_getp32 (addr)
5010
 
     const bfd_byte *addr;
 
5007
static bfd_vma
 
5008
bfd_getp32 (const void *p)
5011
5009
{
5012
 
  return (((((bfd_vma)addr[1] << 8) | addr[0]) << 8)
5013
 
          | addr[3]) << 8 | addr[2];
 
5010
  const bfd_byte *addr = p;
 
5011
  unsigned long v;
 
5012
  v = (unsigned long) addr[1] << 24;
 
5013
  v |= (unsigned long) addr[0] << 16;
 
5014
  v |= (unsigned long) addr[3] << 8;
 
5015
  v |= (unsigned long) addr[2];
 
5016
  return v;
5014
5017
}
5015
5018
 
5016
5019
#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)
5017
5020
 
5018
 
bfd_signed_vma
5019
 
bfd_getp_signed_32 (addr)
5020
 
     const bfd_byte *addr;
 
5021
static bfd_signed_vma
 
5022
bfd_getp_signed_32 (const void *p)
5021
5023
{
5022
 
  return COERCE32((((((bfd_vma)addr[1] << 8) | addr[0]) << 8)
5023
 
                   | addr[3]) << 8 | addr[2]);
 
5024
  const bfd_byte *addr = p;
 
5025
  unsigned long v;
 
5026
  v = (unsigned long) addr[1] << 24;
 
5027
  v |= (unsigned long) addr[0] << 16;
 
5028
  v |= (unsigned long) addr[3] << 8;
 
5029
  v |= (unsigned long) addr[2];
 
5030
  return COERCE32 (v);
5024
5031
}
5025
5032
 
5026
 
void
5027
 
bfd_putp32 (data, addr)
5028
 
     bfd_vma data;
5029
 
     bfd_byte *addr;
 
5033
static void
 
5034
bfd_putp32 (bfd_vma data, void *p)
5030
5035
{
5031
 
  addr[0] = (bfd_byte)(data >> 16);
5032
 
  addr[1] = (bfd_byte)(data >> 24);
5033
 
  addr[2] = (bfd_byte)data;
5034
 
  addr[3] = (bfd_byte)(data >>  8);
 
5036
  bfd_byte *addr = p;
 
5037
  addr[0] = (data >> 16) & 0xff;
 
5038
  addr[1] = (data >> 24) & 0xff;
 
5039
  addr[2] = (data >> 0) & 0xff;
 
5040
  addr[3] = (data >> 8) & 0xff;
5035
5041
}