< prev index next >

src/share/tools/hsdis/hsdis.c

Print this page




 474   return arch_info;
 475 }
 476 
 477 static const char* native_arch_name() {
 478   const char* res = NULL;
 479 #ifdef LIBARCH_i386
 480   res = "i386";
 481 #endif
 482 #ifdef LIBARCH_amd64
 483   res = "i386:x86-64";
 484 #endif
 485 #ifdef LIBARCH_sparc
 486   res = "sparc:v8plusb";
 487 #endif
 488 #ifdef LIBARCH_sparcv9
 489   res = "sparc:v9b";
 490 #endif
 491 #if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le)
 492   res = "powerpc:common64";
 493 #endif



 494   if (res == NULL)
 495     res = "architecture not set in Makefile!";
 496   return res;
 497 }
 498 
 499 static enum bfd_endian native_endian() {
 500   int32_t endian_test = 'x';
 501   if (*(const char*) &endian_test == 'x')
 502     return BFD_ENDIAN_LITTLE;
 503   else
 504     return BFD_ENDIAN_BIG;
 505 }
 506 
 507 static bfd* get_native_bfd(const bfd_arch_info_type* arch_info,
 508                            bfd* empty_bfd, bfd_target* empty_xvec) {
 509   memset(empty_bfd,  0, sizeof(*empty_bfd));
 510   memset(empty_xvec, 0, sizeof(*empty_xvec));
 511   empty_xvec->flavour = bfd_target_unknown_flavour;
 512   empty_xvec->byteorder = native_endian();
 513   empty_bfd->xvec = empty_xvec;




 474   return arch_info;
 475 }
 476 
 477 static const char* native_arch_name() {
 478   const char* res = NULL;
 479 #ifdef LIBARCH_i386
 480   res = "i386";
 481 #endif
 482 #ifdef LIBARCH_amd64
 483   res = "i386:x86-64";
 484 #endif
 485 #ifdef LIBARCH_sparc
 486   res = "sparc:v8plusb";
 487 #endif
 488 #ifdef LIBARCH_sparcv9
 489   res = "sparc:v9b";
 490 #endif
 491 #if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le)
 492   res = "powerpc:common64";
 493 #endif
 494 #ifdef LIBARCH_aarch64
 495   res = "aarch64";
 496 #endif
 497   if (res == NULL)
 498     res = "architecture not set in Makefile!";
 499   return res;
 500 }
 501 
 502 static enum bfd_endian native_endian() {
 503   int32_t endian_test = 'x';
 504   if (*(const char*) &endian_test == 'x')
 505     return BFD_ENDIAN_LITTLE;
 506   else
 507     return BFD_ENDIAN_BIG;
 508 }
 509 
 510 static bfd* get_native_bfd(const bfd_arch_info_type* arch_info,
 511                            bfd* empty_bfd, bfd_target* empty_xvec) {
 512   memset(empty_bfd,  0, sizeof(*empty_bfd));
 513   memset(empty_xvec, 0, sizeof(*empty_xvec));
 514   empty_xvec->flavour = bfd_target_unknown_flavour;
 515   empty_xvec->byteorder = native_endian();
 516   empty_bfd->xvec = empty_xvec;


< prev index next >