Changeset 727
- Timestamp:
- Sep 25, 2003, 8:44:48 PM (22 years ago)
- Location:
- trunk/src/emx/src/emxomf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/emxomf/emxomf.c
-
Property cvs2svn:cvs-rev
changed from
1.26
to1.27
r726 r727 184 184 * Link386 support HLL v3 (?) 185 185 */ 186 int hll_version = 6;186 int hll_version = 4; 187 187 188 188 /* Private variables. */ … … 559 559 NAME. On success, a pointer to the symbol table entry (in the 560 560 array pointed to by sym_ptr) is returned. If the symbol is not 561 found, NULL is returned. */ 562 const struct nlist *find_symbol (const char *name) 561 found, NULL is returned. 562 NOT_ENTRY is an entry index which is not to be found. 563 FEXT is an indicator on whether or not we can find external symbols or 564 not. */ 565 const struct nlist *find_symbol_ex (const char *name, int not_entry, int fext) 563 566 { 564 567 int i, j, n, len, t; … … 580 583 n = sym_count; 581 584 for (j = 0; j < n; ++j) 582 if (sym_ptr[j].n_un.n_strx == sym_ofs )585 if (sym_ptr[j].n_un.n_strx == sym_ofs && j != not_entry) 583 586 { 584 587 t = sym_ptr[j].n_type & ~N_EXT; 585 if ( t == N_TEXT || t == N_DATA || t == N_BSS586 /* kso #465 2003-06-04: Find weak symbols too. */588 if ( t == N_TEXT || t == N_DATA || t == N_BSS 589 || (fext && sym_ptr[j].n_type == N_EXT) 587 590 || (sym_ptr[j].n_type >= N_WEAKA && sym_ptr[j].n_type <= N_WEAKB) 588 591 || (t == 0 && sym_ptr[j].n_value != 0)) … … 593 596 } 594 597 return NULL; /* Symbol not found */ 598 } 599 600 /* Find an a.out symbol. The underscore character `_' is prepended to 601 NAME. On success, a pointer to the symbol table entry (in the 602 array pointed to by sym_ptr) is returned. If the symbol is not 603 found, NULL is returned. */ 604 const struct nlist *find_symbol (const char *name) 605 { 606 return find_symbol_ex (name, -1, 0); 595 607 } 596 608 … … 1099 1111 for (i = 0; i < sym_count; ++i) 1100 1112 if (sym_ptr[i].n_type == (N_INDR|N_EXT)) 1101 { 1102 if (!strstr(str_ptr + sym_ptr[i].n_un.n_strx, "$hll$")) 1103 ++i; /* Skip immediately following entry */ 1104 } 1113 ++i; /* Skip immediately following entry */ 1105 1114 else if (sym_ptr[i].n_type == N_EXT && sym_ptr[i].n_value == 0) 1106 1115 { … … 4023 4032 case 'h': 4024 4033 hll_version = optarg ? atoi(optarg) : 4; 4025 if (hll_version != 4 && hll_version != 3 )4034 if (hll_version != 4 && hll_version != 3 && hll_version != 6) 4026 4035 { 4027 4036 printf ("syntax error: Invalid HLL version specified (%d)\n", hll_version); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomf.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r726 r727 31 31 char *xstrdup (const char *s); 32 32 extern const struct nlist *find_symbol (const char *name); 33 extern const struct nlist *find_symbol_ex (const char *name, int not_entry, int fext); 33 34 34 35 /* These variables are defined in emxomf.c. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/stabshll.c
-
Property cvs2svn:cvs-rev
changed from
1.20
to1.21
r726 r727 27 27 #include <stdlib.h> 28 28 #include <string.h> 29 #include <stdarg.h> 29 30 #include <time.h> 30 31 #include <alloca.h> … … 373 374 374 375 /* kso #456 2003-06-11: Reversed quiet workaround. */ 375 #define no_warning warning 376 #define no_warning warning_parse 376 377 377 378 … … 380 381 *******************************************************************************/ 381 382 static void parse_typedef (int *index); 382 383 383 static void warning_parse (const char *pszFormat, ...); 384 385 386 /** 387 * Report an warning in which might be connecting to parsing. 388 * 389 * @param pszFormat Message string. 390 * @param ... More arguments 391 */ 392 static void warning_parse (const char *pszFormat, ...) 393 { 394 va_list args; 395 396 va_start (args, pszFormat); 397 fprintf (stderr, "emxomf warning: "); 398 vfprintf (stderr, pszFormat, args); 399 va_end (args); 400 fputc ('\n', stderr); 401 402 if (parse_ptr && parse_start && parse_ptr >= parse_start) 403 fprintf (stderr, "emxomf info: Currently parsing '%c' at position %ld in\n%s\n", 404 *parse_ptr, parse_ptr - parse_start, parse_start); 405 } 384 406 385 407 … … 2332 2354 2333 2355 case 'a': 2334 2335 2356 /* An array: ar<index_type>;<lower_bound>;<upper_bound>;<el_type> */ 2336 2357 … … 2441 2462 if (tp->index == -2) 2442 2463 { 2443 no_warning ("Cycle detected by make_type");2464 warning_parse ("Cycle detected by make_type."); 2444 2465 RETURN (0); 2445 2466 } … … 2453 2474 if (t1 == NULL) 2454 2475 { 2455 no_warning("Undefined stabs type %d referenced", tp->d.stabs_ref);2476 warning_parse ("Undefined stabs type %d referenced", tp->d.stabs_ref); 2456 2477 RETURN (0x82); /* 32 bit signed */ 2457 2478 } … … 3236 3257 printf ("%s %s\n", msg, str); 3237 3258 #endif 3259 3238 3260 parse_start = parse_ptr = p + 1; 3239 3261 switch (*parse_ptr) … … 3248 3270 } 3249 3271 if (symbol->n_value == -12357) 3250 { /* Special hack for unresolved externalvariables.3272 { /* Special hack for external and communials variables. 3251 3273 We expect the previous two symbols to be an alias for the 3252 3274 undefined symbol. The first of them will then have the name 3253 of this record with an $hll$ suffix. */ 3275 of this record with an $hll$.* suffix. */ 3276 ++parse_ptr; 3277 ti = hll_type (); 3278 3254 3279 if ( *index >= 2 3255 3280 && symbol[-2].n_type == (N_INDR | N_EXT) … … 3257 3282 && strstr(str_ptr + symbol[-2].n_un.n_strx, "$hll$")) 3258 3283 { 3259 ++parse_ptr; 3260 ti = hll_type (); 3284 const struct nlist *sym2; 3285 int fext = !strstr(str_ptr + symbol[-2].n_un.n_strx, "$hll$comm$"); 3286 3261 3287 #if defined (HLL_DEBUG) 3262 3288 printf (" type=%#x\n", ti); 3263 3289 #endif 3264 sst_static (name, 0, ti, *index - 1, 1); 3290 sym2 = find_symbol_ex (symbol[-1].n_un.n_strx + str_ptr, *index - 1, fext); 3291 if (sym2) 3292 { 3293 if (sym2->n_type == N_EXT) 3294 sst_static (name, 0, ti, sym2 - sym_ptr, 1); 3295 else 3296 sst_static (name, sym2->n_value, ti, sym2->n_type, 0); 3297 break; 3298 } 3265 3299 } 3266 else 3267 { 3268 warning ("Cannot find address of external variable %s", name); 3269 return; 3270 } 3271 break; 3300 warning ("Cannot find address of external variable %s", name); 3301 return; 3272 3302 } 3273 3303 /* fall thru */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.