Subversion Repositories Kolibri OS

Rev

Rev 9284 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9284 Rev 9305
Line 1491... Line 1491...
1491
        s1->dynsymtab_section,
1491
        s1->dynsymtab_section,
1492
        value,
1492
        value,
1493
        dllindex, /* st_size */
1493
        dllindex, /* st_size */
1494
        ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE),
1494
        ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE),
1495
        0,
1495
        0,
-
 
1496
#ifndef TCC_TARGET_KX
1496
        value ? SHN_ABS : SHN_UNDEF,
1497
        value ? SHN_ABS :
-
 
1498
#endif
-
 
1499
		SHN_UNDEF,
1497
        name
1500
        name
1498
        );
1501
        );
1499
}
1502
}
Line 1500... Line 1503...
1500
 
1503
 
Line 1565... Line 1568...
1565
 
1568
 
1566
/* ------------------------------------------------------------- */
1569
/* ------------------------------------------------------------- */
1567
#if !defined(TCC_TARGET_MEOS) || defined (TCC_TARGET_KX)
1570
#if !defined(TCC_TARGET_MEOS) || defined (TCC_TARGET_KX)
1568
static int pe_load_def(TCCState *s1, int fd)
1571
static int pe_load_def(TCCState *s1, int fd)
1569
{
1572
{
1570
    int state = 0, ret = -1, dllindex = 0, ord;
1573
    int state = 0, ret = -1, dllindex = 0, ord = 0;
1571
    char line[400], dllname[80], *p, *x;
1574
    char line[400], dllname[80], *p, *x;
Line 1572... Line 1575...
1572
    FILE *fp;
1575
    FILE *fp;
1573
 
1576
 
Line 1589... Line 1592...
1589
            pstrcpy(dllname, sizeof dllname, trimfront(p+7));
1592
            pstrcpy(dllname, sizeof dllname, trimfront(p+7));
1590
            ++state;
1593
            ++state;
1591
            continue;
1594
            continue;
Line 1592... Line 1595...
1592
 
1595
 
-
 
1596
        case 1:
-
 
1597
#ifdef TCC_TARGET_KX
-
 
1598
		    {
-
 
1599
			      char* p1 = strstr(p, "prefix");
-
 
1600
			      if (p1) {
-
 
1601
				    p[p1 - p - 1] = 0;
-
 
1602
				    ord = -1; // All exports used prefix
-
 
1603
			    }
-
 
1604
		    }
1593
        case 1:
1605
#endif
1594
            if (0 != stricmp(p, "EXPORTS"))
1606
            if (0 != stricmp(p, "EXPORTS"))
1595
                goto quit;
1607
                goto quit;
1596
            ++state;
1608
            ++state;
Line 1597... Line 1609...
1597
            continue;
1609
            continue;
1598
 
1610
 
1599
        case 2:
1611
        case 2:
-
 
1612
            dllindex = add_dllref(s1, dllname);
-
 
1613
            ++state;
-
 
1614
#ifdef TCC_TARGET_KX
-
 
1615
			     if (ord == - 1) {
-
 
1616
				    char* tmp = strchr(dllname, '.');
-
 
1617
				    int n = tmp - dllname;
-
 
1618
				    dllname[n] = '_';
-
 
1619
				    dllname[n + 1] = 0;
1600
            dllindex = add_dllref(s1, dllname);
1620
			    }
1601
            ++state;
1621
#endif
-
 
1622
            /* fall through */
-
 
1623
        default:
-
 
1624
#ifdef TCC_TARGET_KX
-
 
1625
			     if ((ord == -1) && p != strstr(p, dllname))
1602
            /* fall through */
1626
				    tcc_error_noabort("Wrong prefix for %s", p);
1603
        default:
1627
#else
1604
            /* get ordinal and will store in sym->st_value */
1628
            /* get ordinal and will store in sym->st_value */
1605
            ord = 0;
1629
            //ord = 0; // ord  is assign in begining of function
1606
            x = strchr(p, ' ');
1630
            x = strchr(p, ' ');
1607
            if (x) {
1631
            if (x) {
1608
                *x = 0, x = strrchr(x + 1, '@');
1632
                *x = 0, x = strrchr(x + 1, '@');
1609
                if (x) {
1633
                if (x) {
1610
                    char *d;
1634
                    char *d;
1611
                    ord = (int)strtol(x + 1, &d, 10);
1635
                    ord = (int)strtol(x + 1, &d, 10);
1612
                    if (*d)
1636
                    if (*d)
1613
                        ord = 0;
1637
                        ord = 0;
-
 
1638
                }
1614
                }
1639
            }
1615
            }
1640
#endif
1616
            pe_putimport(s1, dllindex, p, ord);
1641
            pe_putimport(s1, dllindex, p, ord);
1617
            continue;
1642
            continue;
1618
        }
1643
        }