Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/bfd/coffgen.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by monamour, Thu Dec 4 05:12:56 2008 UTC revision 21 by monamour, Mon Jul 27 20:34:36 2009 UTC
# Line 1  Line 1 
1  /* Support for the generic parts of COFF, for BFD.  /* Support for the generic parts of COFF, for BFD.
2     Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,     Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3     2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008     2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
4     Free Software Foundation, Inc.     Free Software Foundation, Inc.
5     Written by Cygnus Support.     Written by Cygnus Support.
6    
# Line 59  make_a_section_from_file (bfd *abfd, Line 59  make_a_section_from_file (bfd *abfd,
59    
60    name = NULL;    name = NULL;
61    
62    /* Handle long section names as in PE.  */    /* Handle long section names as in PE.  On reading, we want to
63    if (bfd_coff_long_section_names (abfd)      accept long names if the format permits them at all, regardless
64        of the current state of the flag that dictates if we would generate
65        them in outputs; this construct checks if that is the case by
66        attempting to set the flag, without changing its state; the call
67        will fail for formats that do not support long names at all.  */
68      if (bfd_coff_set_long_section_names (abfd, bfd_coff_long_section_names (abfd))
69        && hdr->s_name[0] == '/')        && hdr->s_name[0] == '/')
70      {      {
71        char buf[SCNNMLEN];        char buf[SCNNMLEN];
# Line 68  make_a_section_from_file (bfd *abfd, Line 73  make_a_section_from_file (bfd *abfd,
73        char *p;        char *p;
74        const char *strings;        const char *strings;
75    
76          /* Flag that this BFD uses long names, even though the format might
77             expect them to be off by default.  This won't directly affect the
78             format of any output BFD created from this one, but the information
79             can be used to decide what to do.  */
80          bfd_coff_set_long_section_names (abfd, TRUE);
81        memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1);        memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1);
82        buf[SCNNMLEN - 1] = '\0';        buf[SCNNMLEN - 1] = '\0';
83        strindex = strtol (buf, &p, 10);        strindex = strtol (buf, &p, 10);
# Line 1949  coff_print_symbol (bfd *abfd, Line 1959  coff_print_symbol (bfd *abfd,
1959                     combined->u.syment.n_type,                     combined->u.syment.n_type,
1960                     combined->u.syment.n_sclass,                     combined->u.syment.n_sclass,
1961                     combined->u.syment.n_numaux);                     combined->u.syment.n_numaux);
1962  #ifdef BFD64            bfd_fprintf_vma (abfd, file, val);
           /* fprintf_vma() on a 64-bit enabled host will always print a 64-bit  
              value, but really we want to display the address in the target's  
              address size.  Since we do not have a field in the bfd structure  
              to tell us this, we take a guess, based on the target's name.  */  
           if (strstr (bfd_get_target (abfd), "64") == NULL)  
             fprintf (file, "%08lx", (unsigned long) (val & 0xffffffff));  
           else  
 #endif  
             fprintf_vma (file, val);  
1963            fprintf (file, " %s", symbol->name);            fprintf (file, " %s", symbol->name);
1964    
1965            for (aux = 0; aux < combined->u.syment.n_numaux; aux++)            for (aux = 0; aux < combined->u.syment.n_numaux; aux++)
# Line 2001  coff_print_symbol (bfd *abfd, Line 2002  coff_print_symbol (bfd *abfd,
2002                      }                      }
2003                      /* Otherwise fall through.  */                      /* Otherwise fall through.  */
2004                  case C_EXT:                  case C_EXT:
2005                    case C_AIX_WEAKEXT:
2006                    if (ISFCN (combined->u.syment.n_type))                    if (ISFCN (combined->u.syment.n_type))
2007                      {                      {
2008                        long next, llnos;                        long next, llnos;
# Line 2040  coff_print_symbol (bfd *abfd, Line 2042  coff_print_symbol (bfd *abfd,
2042                while (l->line_number)                while (l->line_number)
2043                  {                  {
2044                    fprintf (file, "\n%4d : ", l->line_number);                    fprintf (file, "\n%4d : ", l->line_number);
2045                    fprintf_vma (file, l->u.offset + symbol->section->vma);                    bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma);
2046                    l++;                    l++;
2047                  }                  }
2048              }              }

Legend:
Removed from v.20  
changed lines
  Added in v.21

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26