Changeset 524


Ignore:
Timestamp:
Aug 4, 2003, 8:24:20 PM (22 years ago)
Author:
bird
Message:

bugfixes.

Location:
trunk/src/emx/src/emxomf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/emxomfld.c

    • Property cvs2svn:cvs-rev changed from 1.17 to 1.18
    r523 r524  
    825825      /* add argument to argument vector. */
    826826      if (!(argi % 32))
    827         argv = xrealloc(argv, argi + 32);
     827        argv = xrealloc(argv, argi + 32 + 1);
    828828      argv[argi++] = xstrdup(psz);
    829829
     
    831831      psz = psz2;                           
    832832    }
     833  argv[argi] = NULL;
    833834
    834835  /* Spawn process. */
  • trunk/src/emx/src/emxomf/weakld.c

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r523 r524  
    14471447        /*
    14481448         * We'll simply return existing symbol when:
    1449          *      1. adding a UNDEF where a PUBLIC or COMM exists.
     1449         *      1. adding a UNDEF where a PUBLIC, COMM, !WEAK UNDEF or IMPORT exists.
    14501450         *      2. adding a WKEXT where a PUBLIC or COMM exists.
    14511451         *      3. adding a WKEXT where a UNDEF which isn't UNCERTAIN exists.
     
    14551455        if ( (     /* 1 */
    14561456                (fFlags & WLDSF_TYPEMASK) == WLDSF_UNDEF
    1457              && ((pSym->fFlags & WLDSF_TYPEMASK) == WLDSF_PUBLIC || (pSym->fFlags & WLDSF_TYPEMASK) == WLDSF_COMM
    1458                  || (pSym->fFlags & (WLDSF_TYPEMASK | WLDSF_WEAK)) == WLDSF_UNDEF)
     1457             && ((pSym->fFlags & WLDSF_TYPEMASK) == WLDSF_PUBLIC || (pSym->fFlags & WLDSF_TYPEMASK) == WLDSF_COMM 
     1458                 || (pSym->fFlags & (WLDSF_TYPEMASK | WLDSF_WEAK)) == WLDSF_UNDEF || (pSym->fFlags & (WLDSF_TYPEMASK)) == WLDSF_IMPORT)
    14591459            ) || ( /* 2 */
    14601460                (fFlags & WLDSF_TYPEMASK) == WLDSF_WKEXT
     
    15911591
    15921592    /* Add the strings we'll need them very soon */
    1593     pszImpMod = strpool_addnu(pWld->pStrMisc, pachModName, cchModName);
     1593    if (cchModName > 0)
     1594        pszImpMod = strpool_addnu(pWld->pStrMisc, pachModName, cchModName);
     1595    else
     1596        pszImpMod = strpool_addu(pWld->pStrMisc, pachModName);
    15941597    pszImpName = NULL;
    15951598    if (!uOrdinal)
    15961599    {
    1597         if (!pachImpName || cchImpName == 0 )
     1600        /* If no imp name, we'll use the name we know it as. */
     1601        if (!pachImpName || cchImpName == 0 || !*pachImpName)
    15981602        {
    15991603            pachImpName = pachName;
    16001604            cchImpName = cchName;
    16011605        }
    1602         pszImpName = strpool_addn(pWld->pStrMisc, pachImpName, cchImpName);
     1606        if (cchImpName > 0)
     1607            pszImpName = strpool_addn(pWld->pStrMisc, pachImpName, cchImpName);
     1608        else
     1609            pszImpName = strpool_add(pWld->pStrMisc, pachImpName);
    16031610    }
    16041611
     
    16901697
    16911698    /* set default name */
    1692     if (!pachIntName || !cchIntName)
    1693     {
    1694         pachExpName = pachIntName;
    1695         cchExpName = cchIntName;
     1699    if (!pachIntName || !cchIntName || !*pachIntName)
     1700    {
     1701        pachIntName = pachExpName;
     1702        cchIntName = cchExpName;
    16961703    }
    16971704
     
    18781885     */
    18791886    pSym = symAdd(pWld, pMod, WLDSF_COMM | (fLibSearch ? WLDSF_LIBSEARCH : 0),
    1880                   pachName, cchName, NULL);
     1887                  pachName, cchName, &eAction);
    18811888    if (!pSym)
    18821889        return NULL;
     
    18911898
    18921899        case WLDSA_UP:
     1900            if ((pSym->fFlags & (WLDSF_TYPEMASK)) != WLDSF_COMM)
     1901                break;
     1902            /* fallthru */
    18931903        case WLDSA_OLD:
    18941904            /* merge size */
     
    18971907            if (pSym->u.comm.cb < cbElement)
    18981908                pSym->u.comm.cb = cbElement;
    1899             pSym = NULL;
    19001909            break;
    19011910
     
    23142323int     wldDestroy(PWLD pWld)
    23152324{
     2325    PWLDMOD     pObj;
     2326    PWLDLIB     pLib;
     2327
    23162328    if (!pWld)
    23172329        return 0;
    23182330    if (pWld->fFlags & WLDC_VERBOSE)
    23192331        fprintf(stderr, "weakld: info: destroying linker instance\n");
     2332
     2333    /* free mods */
     2334    for (pObj = pWld->pObjs; pObj;)
     2335    {
     2336        void *pv = pObj;   
     2337        pObj = pObj->pNext;
     2338        free(pv);
     2339    }
     2340    for (pObj = pWld->pDef; pObj;)
     2341    {
     2342        void *pv = pObj;   
     2343        pObj = pObj->pNext;
     2344        free(pv);
     2345    }
     2346
     2347    /* free libs */
     2348    for (pLib = pWld->pLibs; pLib;)
     2349    {
     2350        void *pv = pLib;   
     2351        pLib = pLib->pNext;
     2352        free(pv);
     2353    }
    23202354
    23212355    /* members and finally the instance structure. */
     
    24462480                uOrdinal = pStmt->import.ordinal;
    24472481            pSym = symAddImport(pParam->pWld, pParam->pMod, 0,
    2448                                 pStmt->import.entryname, -1,
     2482                                pStmt->import.entryname[0] ? pStmt->import.entryname : pStmt->import.internalname, -1,
    24492483                                pStmt->import.internalname, -1,
    24502484                                pStmt->import.modulename, -1,
Note: See TracChangeset for help on using the changeset viewer.