}
}
-int
-buffer_read_memory(addr, buffer, size, info)
- bfd_vma addr;
- bfd_byte *buffer;
- int32 size;
- struct disassemble_info *info;
-{
- if (size == sis_memory_read(addr, buffer, size))
- return (0);
- else
- return (1);
-}
-
-void
-perror_memory(status, addr, info)
- int32 status;
- bfd_vma addr;
- struct disassemble_info *info;
-{
-
- printf("Could not read address 0x%08x\n", (unsigned int) addr);
-}
-
-void
-generic_print_address(addr, info)
- bfd_vma addr;
- struct disassemble_info *info;
-{
-
- printf("0x%x", (unsigned int) addr);
-}
-
-/* Just return the given address. */
-
-int
-generic_symbol_at_address (addr, info)
- bfd_vma addr;
- struct disassemble_info * info;
-{
- return 1;
-}
-
-
/* Add event to event queue */
void
#include "ansidecl.h"
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "libiberty.h"
#include "bfd.h"
else
current_target_byte_order = BIG_ENDIAN;
if (sis_verbose)
- printf("file %s is little-endian.\n", fname);
+ printf("file %s is %s-endian.\n", fname,
+ current_target_byte_order == BIG_ENDIAN ? "big" : "little");
if (sis_verbose)
printf("loading %s:", fname);
* Adjust sections from a.out files, since they don't carry their
* addresses with.
*/
- if (bfd_get_flavour(pbfd) == bfd_target_aout_flavour)
- section_address += bfd_get_start_address (pbfd);
+ if (bfd_get_flavour(pbfd) == bfd_target_aout_flavour) {
+ if (strcmp (section_name, ".text") == 0)
+ section_address = bfd_get_start_address (pbfd);
+ else if (strcmp (section_name, ".data") == 0) {
+ /* Read the first 8 bytes of the data section.
+ There should be the string 'DaTa' followed by
+ a word containing the actual section address. */
+ struct data_marker
+ {
+ char signature[4]; /* 'DaTa' */
+ unsigned char sdata[4]; /* &sdata */
+ } marker;
+ bfd_get_section_contents (pbfd, section, &marker, 0,
+ sizeof (marker));
+ if (strncmp (marker.signature, "DaTa", 4) == 0)
+ {
+ if (current_target_byte_order == BIG_ENDIAN)
+ section_address = bfd_getb32 (marker.sdata);
+ else
+ section_address = bfd_getl32 (marker.sdata);
+ }
+ }
+ }
+
section_size = bfd_section_size(pbfd, section);
if (sis_verbose)
- printf("\nsection %s at 0x%08lx (%ld bytes)",
+ printf("\nsection %s at 0x%08lx (0x%lx bytes)",
section_name, section_address, section_size);
/* Text, data or lit */