Changeset 762


Ignore:
Timestamp:
Sep 30, 2003, 8:18:11 PM (22 years ago)
Author:
bird
Message:

Re-did the external/communal 'G' hack.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gcc/gcc/dbxout.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r761 r762  
    23182318          current_sym_code = N_GSYM;
    23192319#ifdef EMX
    2320           /* bird: This is hacks for two things. The first part, to use the
    2321              value of a 'G', is intended to help resolving global symbols
    2322              when the variable name isn't equal to the assembler name. f.ex.:
     2320          /* bird: Two hacks.
     2321             1) Get right address for globals. We're using the value field of
     2322                the entry for this. This makes the following code work:
    23232323                class foo { foo() {static const char *psz= "foo";} };
    2324              The 2nd hack is for external symbols, which we need debug info for
    2325              on EMX due to HLL conversion. In that case we need to find the
    2326              variable somehow and generates a special alias symbol for it.
    2327              The alias is a pretty unique name which includes the string
    2328              '$hll$' which is what we'll look for. ld accept multiple
    2329              definitions of aliases so it's not really a problem there. The
    2330              value of these 'G' stabs are always -12357.  */
     2324             2) Hack 1 doesn't work for external or communal data. They would
     2325                both require a fixup of the stabs value to work - which a.out
     2326                naturally doesn't support (ELF does though).
     2327                So, what we'll do is to make an extra entry before the 'G'
     2328                entry which tells us the symbol name.
     2329                In this case the value of the 'G' entry is -12357.  */
    23312330          if (use_gnu_debug_info_extensions)
    23322331            {
     
    23342333              if (DECL_EXTERNAL (decl) || DECL_COMMON (decl))
    23352334                {
    2336                   struct timeval tv;
    2337                   /* We'll make a special alias for the external and .comm
    2338                      symbol which the a.out -> omf copy will detect.
    2339                      Todo: This should really be _after_ the symbol. */
    2340                   dbxout_symbol_name (decl, suffix, letter);
    2341                   gettimeofday(&tv, NULL);
    2342                   fprintf (asmfile, "$hll$%s$%lx%08lx\",%d,0,0,0\n",
    2343                            DECL_EXTERNAL (decl) ? "ext" : "comm",
    2344                            tv.tv_sec, tv.tv_usec, /*N_INDR | N_EXT*/11);
    23452335                  fprintf (asmfile, "\t.stabs\t\"");
    23462336                  output_addr_const (asmfile, current_sym_addr);
    2347                   fprintf (asmfile, "\",%d,0,0,0\n", /*N_EXT*/ 1);
     2337#if 0
     2338                  fprintf (asmfile, "\",%d,0,0,0\n", /*N_EXT | N_UNDF*/1);
     2339#else
     2340                  fprintf (asmfile, "\",%d,0,0,0\n", /*extension*/ 0xfe);
     2341#endif
    23482342                  current_sym_addr = 0;
    23492343                  current_sym_value = -12357;
Note: See TracChangeset for help on using the changeset viewer.