Changeset 720


Ignore:
Timestamp:
Sep 24, 2003, 8:29:22 PM (22 years ago)
Author:
bird
Message:

#456: Attempts on DBGPACK support - linker doesn't like our debug info thus not working yet.
#456: Hack for making debug info for global external variables. ($hll$)

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.25 to 1.26
    r719 r720  
    184184 * Link386              support HLL v3 (?)
    185185 */
    186 int hll_version = 4;
     186int hll_version = 6;
    187187
    188188/* Private variables. */
     
    10861086   À
    10871087
    1088    Symbol indices are assigned sequentially. */
     1088   Symbol indices are assigned sequentially.
     1089
     1090   Note. $hll$ is a hack for making debug info for global externals,
     1091   we need the extdef for the 2nd entry of the fake alias. */
    10891092
    10901093static void write_extdef (void)
     
    10961099  for (i = 0; i < sym_count; ++i)
    10971100    if (sym_ptr[i].n_type == (N_INDR|N_EXT))
    1098       ++i;                      /* Skip immediately following entry */
     1101      {
     1102        if (!strstr(str_ptr + sym_ptr[i].n_un.n_strx, "$hll$"))
     1103          ++i;                    /* Skip immediately following entry */
     1104      }
    10991105    else if (sym_ptr[i].n_type == N_EXT && sym_ptr[i].n_value == 0)
    11001106      {
     
    12721278
    12731279
    1274 /* Write ALIAS records into the output file for all indirect
    1275    references. */
     1280/* Write ALIAS records into the output file for all indirect references.
     1281   Note. The $hll$ aliases are debug info hacks and must be skipped! */
    12761282
    12771283static void write_alias (void)
     
    12811287
    12821288  for (i = 0; i < sym_count - 1; ++i)
    1283     if (sym_ptr[i].n_type == (N_INDR|N_EXT) && sym_ptr[i+1].n_type == N_EXT)
     1289    if (sym_ptr[i].n_type == (N_INDR|N_EXT) && sym_ptr[i+1].n_type == N_EXT
     1290     && !strstr(str_ptr + sym_ptr[i].n_un.n_strx, "$hll$"))
    12841291      {
    12851292        init_rec (ALIAS);
     
    13931400    int i;
    13941401
    1395     if (opt_rmunder || strip_symbols)
     1402    if (opt_rmunder || strip_symbols || !a_out_h->a_syms)
    13961403        return;
    13971404
     
    20352042static void write_debug_style (void)
    20362043{
     2044  if (strip_symbols || !a_out_h->a_syms)
     2045    return;
    20372046  init_rec (COMENT);
    20382047  put_8 (0x80);
     
    28382847
    28392848
     2849/* Tell ilink which TIS (Tools I Standard) version we follow.
     2850   (At least that's what I think this comment record is good for). */
     2851static void write_tis ()
     2852{
     2853  unsigned short ver = 0;
     2854  char *type = getenv ("EMXOMFLD_TYPE");
     2855  if (type && !stricmp (type, "VAC308"))
     2856      ver = 0x0100;
     2857  else if (!type || !stricmp (type, "VAC365"))
     2858      ver = 0x0101;
     2859  /* else: no TIS record for link386! */
     2860
     2861  if (ver)
     2862    {
     2863      init_rec (COMENT);
     2864      put_8 (0x00);
     2865      put_8 (CLASS_TIS);
     2866      put_mem ("TIS", 3);
     2867      put_16 (ver);
     2868      write_rec ();
     2869    }
     2870}
     2871
     2872
    28402873/* Tell ilink which dll to use when /DBGPACK is specificed. The dllname
    28412874   is given without extension. */
    28422875static void write_dbgpack ()
    28432876{
    2844     const char *name = dbgpack_name;
    2845     if (!name)
    2846       {
    2847         char *type = getenv ("EMXOMFLD_TYPE");
    2848         if (type && !stricmp (type, "VAC308"))
    2849             name = "LNKOH410";
    2850         else if (!type || !stricmp (type, "VAC365"))
    2851             name = "CPPLH436";
    2852         /* no DLL for link386! */
    2853       }
    2854 
    2855     if (name)
    2856       {
    2857         init_rec (COMENT);
    2858         put_8 (0x80);
    2859         put_8 (CLASS_DBGPACK);
    2860         put_str (name);
    2861         write_rec ();
    2862       }
     2877  const char *name = dbgpack_name;
     2878  if (strip_symbols || !a_out_h->a_syms)
     2879    return;
     2880  if (!name)
     2881    {
     2882      char *type = getenv ("EMXOMFLD_TYPE");
     2883      if (type && !stricmp (type, "VAC308"))
     2884          name = "LNKOH410";
     2885      else if (!type || !stricmp (type, "VAC365"))
     2886          name = hll_version == 4 ?  "CPPLH436" : "CPPLH636";
     2887      /* no DLL for link386! */
     2888    }
     2889
     2890  if (name)
     2891    {
     2892      init_rec (COMENT);
     2893      put_8 (0x80);
     2894      put_8 (CLASS_DBGPACK);
     2895      put_str (name);
     2896      write_rec ();
     2897    }
    28632898}
    28642899
     
    33533388  else
    33543389    udat_seg_name = data_seg_name;
    3355   if (!strip_symbols)
     3390  if (!strip_symbols && a_out_h->a_syms)
    33563391    {
    33573392      symbols_seg_name = find_lname ("$$SYMBOLS");
     
    33613396  data_class_name = find_lname ("DATA");
    33623397  bss_class_name = find_lname ("BSS");
    3363   if (!strip_symbols)
     3398  if (!strip_symbols && a_out_h->a_syms)
    33643399    {
    33653400      debsym_class_name = find_lname ("DEBSYM");
     
    33823417  write_theadr ();
    33833418
    3384   /* Tell LINK386 what identifier manipulator DLL to use. */
    3385 
    3386   write_idmdll ();
    3387 
    3388   /* Tell ilink what DBGPACK DLL to use. */
    3389 
    3390   write_dbgpack ();
     3419  /* Tell ilink what TIS standard we follow. */
     3420
     3421  write_tis ();
    33913422
    33923423  /* Write default library requests and the debug information style
     
    33953426  write_libs ();
    33963427  write_debug_style ();
     3428
     3429  /* Tell ilink what DBGPACK DLL to use. */
     3430
     3431  write_dbgpack ();
     3432
     3433  /* Tell LINK386 what identifier manipulator DLL to use. */
     3434
     3435  write_idmdll ();
    33973436
    33983437  /* Define all the OMF names (LNAMES record).  Of course, we must not
     
    34233462    stack_index = seg_def (stack_seg_name, stack_class_name, 0x8000, TRUE, FALSE);
    34243463
    3425   if (!strip_symbols)
     3464  if (!strip_symbols && a_out_h->a_syms)
    34263465    {
    34273466      convert_debug ();         /* After seg_def of text, data & bss */
     
    34783517  write_set_data ();
    34793518
    3480   if (!strip_symbols)
     3519  if (!strip_symbols && a_out_h->a_syms)
    34813520    {
    34823521      write_seg (types_index, types_seg_name, tt.buf, tt.size, NULL, 0, FALSE,
     
    39573996
    39583997  tmp = getenv("EMXOMFLD_TYPE");
    3959   if (tmp && !stricmp(tmp, "LINK386"))
    3960       hll_version = 3;
     3998  if (tmp)
     3999    {
     4000      if (!stricmp (tmp, "VAC308"))
     4001        hll_version = 4;
     4002      else if (!stricmp (tmp, "LINK386"))
     4003        hll_version = 3;
     4004    }
    39614005
    39624006  /* Parse the command line options. */
Note: See TracChangeset for help on using the changeset viewer.