Add support fpr MAXQ processor
[deliverable/binutils-gdb.git] / bfd / peicode.h
index 094f52d2aebe049d636393034d49976042ddb52f..ab940f76850c2d3ac6000c1f51c1b4dc4ed38d51 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for the generic parts of PE/PEI, for BFD.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Solutions.
 
@@ -135,7 +135,7 @@ static asection_ptr       pe_ILF_make_a_section   PARAMS ((pe_ILF_vars *, const
 static void               pe_ILF_make_a_reloc     PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr));
 static void               pe_ILF_make_a_symbol    PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword));
 static void               pe_ILF_save_relocs      PARAMS ((pe_ILF_vars *, asection_ptr));
-static void              pe_ILF_make_a_symbol_reloc  PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int));
+static void              pe_ILF_make_a_symbol_reloc  PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct bfd_symbol **, unsigned int));
 static bfd_boolean        pe_ILF_build_a_bfd      PARAMS ((bfd *, unsigned int, bfd_byte *, bfd_byte *, unsigned int, unsigned int));
 static const bfd_target * pe_ILF_object_p         PARAMS ((bfd *));
 static const bfd_target * pe_bfd_object_p        PARAMS ((bfd *));
@@ -470,7 +470,7 @@ static void
 pe_ILF_make_a_symbol_reloc (pe_ILF_vars *                 vars,
                            bfd_vma                       address,
                            bfd_reloc_code_real_type      reloc,
-                           struct symbol_cache_entry **  sym,
+                           struct bfd_symbol **  sym,
                            unsigned int                  sym_index)
 {
   arelent * entry;
@@ -784,13 +784,13 @@ pe_ILF_build_a_bfd (bfd *           abfd,
 
     case IMPORT_CONST:
       /* XXX code yet to be written.  */
-      _bfd_error_handler (_("%s: Unhandled import type; %x"),
-                         bfd_archive_filename (abfd), import_type);
+      _bfd_error_handler (_("%B: Unhandled import type; %x"),
+                         abfd, import_type);
       return FALSE;
 
     default:
-      _bfd_error_handler (_("%s: Unrecognised import type; %x"),
-                         bfd_archive_filename (abfd), import_type);
+      _bfd_error_handler (_("%B: Unrecognised import type; %x"),
+                         abfd, import_type);
       return FALSE;
     }
 
@@ -803,8 +803,8 @@ pe_ILF_build_a_bfd (bfd *           abfd,
       break;
 
     default:
-      _bfd_error_handler (_("%s: Unrecognised import name type; %x"),
-                         bfd_archive_filename (abfd), import_name_type);
+      _bfd_error_handler (_("%B: Unrecognised import name type; %x"),
+                         abfd, import_name_type);
       return FALSE;
     }
 
@@ -902,10 +902,40 @@ pe_ILF_build_a_bfd (bfd *           abfd,
       symbol = symbol_name;
 
       if (import_name_type != IMPORT_NAME)
-       /* Skip any prefix in symbol_name.  */
-       while (*symbol == '@' || * symbol == '?' || * symbol == '_')
-         ++ symbol;
-
+       {
+         bfd_boolean skipped_leading_underscore = FALSE;
+         bfd_boolean skipped_leading_at = FALSE;
+         bfd_boolean skipped_leading_question_mark = FALSE;
+         bfd_boolean check_again;
+         
+         /* Skip any prefix in symbol_name.  */
+         -- symbol;
+         do
+           {
+             check_again = FALSE;
+             ++ symbol;
+
+             switch (*symbol)
+               {
+               case '@':
+                 if (! skipped_leading_at)
+                   check_again = skipped_leading_at = TRUE;
+                 break;
+               case '?':
+                 if (! skipped_leading_question_mark)
+                   check_again = skipped_leading_question_mark = TRUE;
+                 break;
+               case '_':
+                 if (! skipped_leading_underscore)
+                   check_again = skipped_leading_underscore = TRUE;
+                 break;
+               default:
+                 break;
+               }
+           }
+         while (check_again);
+       }
+      
       if (import_name_type == IMPORT_NAME_UNDECORATE)
        {
          /* Truncate at the first '@'  */
@@ -967,11 +997,11 @@ pe_ILF_build_a_bfd (bfd *           abfd,
       if (magic == MIPS_ARCH_MAGIC_WINCE)
        {
          pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 0, BFD_RELOC_HI16_S,
-                                     (struct symbol_cache_entry **) imp_sym,
+                                     (struct bfd_symbol **) imp_sym,
                                      imp_index);
          pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_LO16, text);
          pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 4, BFD_RELOC_LO16,
-                                     (struct symbol_cache_entry **) imp_sym,
+                                     (struct bfd_symbol **) imp_sym,
                                      imp_index);
        }
       else
@@ -1160,9 +1190,9 @@ pe_ILF_object_p (bfd * abfd)
       /* We no longer support PowerPC.  */
     default:
       _bfd_error_handler
-       (
-_("%s: Unrecognised machine type (0x%x) in Import Library Format archive"),
-         bfd_archive_filename (abfd), machine);
+       (_("%B: Unrecognised machine type (0x%x)"
+          " in Import Library Format archive"),
+        abfd, machine);
       bfd_set_error (bfd_error_malformed_archive);
 
       return NULL;
@@ -1172,9 +1202,9 @@ _("%s: Unrecognised machine type (0x%x) in Import Library Format archive"),
   if (magic == 0)
     {
       _bfd_error_handler
-       (
-_("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"),
-        bfd_archive_filename (abfd), machine);
+       (_("%B: Recognised but unhandled machine type (0x%x)"
+          " in Import Library Format archive"),
+        abfd, machine);
       bfd_set_error (bfd_error_wrong_format);
 
       return NULL;
@@ -1190,8 +1220,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
   if (size == 0)
     {
       _bfd_error_handler
-       (_("%s: size field is zero in Import Library Format header"),
-        bfd_archive_filename (abfd));
+       (_("%B: size field is zero in Import Library Format header"), abfd);
       bfd_set_error (bfd_error_malformed_archive);
 
       return NULL;
@@ -1221,8 +1250,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc
   if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size))
     {
       _bfd_error_handler
-       (_("%s: string not null terminated in ILF object file."),
-        bfd_archive_filename (abfd));
+       (_("%B: string not null terminated in ILF object file."), abfd);
       bfd_set_error (bfd_error_malformed_archive);
       bfd_release (abfd, ptr);
       return NULL;
This page took 0.029487 seconds and 4 git commands to generate.