Ignore:
Timestamp:
Oct 13, 2013, 12:59:38 AM (12 years ago)
Author:
bird
Message:

Mach-O: Set the link address to the address of the first segment we define, simpler that way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdrModMachO.c

    r59 r60  
    651651                        cbStringPool += kHlpStrNLen(&pSrcSeg->segname[0], sizeof(pSrcSeg->segname)) + 1; \
    652652                        cSegments++; \
    653                         \
    654                         /* Link address lower? */ \
    655                         if (*pLinkAddress > pSrcSeg->vmaddr) \
     653                        if (cSegments == 1) /* The link address is set by the first segment. */  \
    656654                            *pLinkAddress = pSrcSeg->vmaddr; \
    657655                    } \
     
    811809                                    cbStringPool += kHlpStrNLen(&pSect->sectname[0], sizeof(pSect->sectname)) + 1; \
    812810                                    cSegments++; \
    813                                     \
    814                                     /* Link address lower? Very unlikely. */ \
    815                                     if (*pLinkAddress > pSect->addr) \
     811                                    if (cSegments == 1) /* The link address is set by the first segment. */  \
    816812                                        *pLinkAddress = pSect->addr; \
    817813                                } \
     
    11531149                do { \
    11541150                    KBOOL fAddSegOuter = K_FALSE; \
    1155                     \
    1156                     kHlpAssert(pSrcSeg->vmaddr >= pModMachO->LinkAddress); \
    11571151                    \
    11581152                    /* \
Note: See TracChangeset for help on using the changeset viewer.