06-16-09-Loader

From Msim

Jump to: navigation, search

This refers to the changes to loader.c that were required to properly load binaries generated with gcc-4.3.2

.got

The .got section was ignored in prior releases, however, it must be loaded. It is loaded the same way as a data section.
Old code:

   case ECOFF_STYP_SDATA:
#if 0
    Sdata_seek = MD_SWAPQ(shdr.s_scnptr);
#endif
     if(MD_SWAPQ(shdr.s_size) > 0)

New code:

   case ECOFF_STYP_SDATA:
#if 0
    Sdata_seek = MD_SWAPQ(shdr.s_scnptr);
#endif

   //Cross-compiled code is accessing data from .got which is ignored, this handles that issue.
   //fall through is appropriate here.
   case ECOFF_STYP_GOT:
    if(MD_SWAPQ(shdr.s_size) > 0)


ECOFF_STYP_GOT needs to be defined in target-alpha/ecoff.h

#define ECOFF_STYP_BSS          0x0080
#define ECOFF_STYP_GOT          0x1000
Personal tools