Add symbol called __nm_<name> to exported symbols created by dlltool.
[binutils-gdb.git] / binutils / dwarf.c
index 420ae5d6810c98028740c45b08600c2fc5c27345..86a838559bf187dfcc59f5a4ac5675e1242d6a67 100644 (file)
@@ -1322,12 +1322,16 @@ decode_location_expression (unsigned char * data,
            print_dwarf_vma (addr, pointer_size);
          }
          break;
+       case DW_OP_implicit_pointer:
        case DW_OP_GNU_implicit_pointer:
          /* XXX: Strictly speaking for 64-bit DWARF3 files
             this ought to be an 8-byte wide computation.  */
          if (dwarf_version == -1)
            {
-             printf (_("(DW_OP_GNU_implicit_pointer in frame info)"));
+             printf (_("(%s in frame info)"),
+                     (op == DW_OP_implicit_pointer
+                      ? "DW_OP_implicit_pointer"
+                      : "DW_OP_GNU_implicit_pointer"));
              /* No way to tell where the next op is, so just bail.  */
              return need_frame_base;
            }
@@ -1339,7 +1343,9 @@ decode_location_expression (unsigned char * data,
            {
              SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end);
            }
-         printf ("DW_OP_GNU_implicit_pointer: <0x%s> %s",
+         printf ("%s: <0x%s> %s",
+                 (op == DW_OP_implicit_pointer
+                  ? "DW_OP_implicit_pointer" : "DW_OP_GNU_implicit_pointer"),
                  dwarf_vmatoa ("x", uvalue),
                  dwarf_vmatoa ("d", read_sleb128 (data,
                                                   &bytes_read, end)));
@@ -1363,40 +1369,55 @@ decode_location_expression (unsigned char * data,
          if (data > end)
            data = end;
          break;
+       case DW_OP_const_type:
        case DW_OP_GNU_const_type:
          uvalue = read_uleb128 (data, &bytes_read, end);
          data += bytes_read;
-         printf ("DW_OP_GNU_const_type: <0x%s> ",
+         printf ("%s: <0x%s> ",
+                 (op == DW_OP_const_type ? "DW_OP_const_type"
+                                         : "DW_OP_GNU_const_type"),
                  dwarf_vmatoa ("x", cu_offset + uvalue));
          SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end);
          data = display_block (data, uvalue, end, ' ');
          break;
+       case DW_OP_regval_type:
        case DW_OP_GNU_regval_type:
          uvalue = read_uleb128 (data, &bytes_read, end);
          data += bytes_read;
-         printf ("DW_OP_GNU_regval_type: %s (%s)",
+         printf ("%s: %s (%s)",
+                 (op == DW_OP_regval_type ? "DW_OP_regval_type"
+                                          : "DW_OP_GNU_regval_type"),
                  dwarf_vmatoa ("u", uvalue), regname (uvalue, 1));
          uvalue = read_uleb128 (data, &bytes_read, end);
          data += bytes_read;
          printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue));
          break;
+       case DW_OP_deref_type:
        case DW_OP_GNU_deref_type:
          SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end);
-         printf ("DW_OP_GNU_deref_type: %ld", (long) uvalue);
+         printf ("%s: %ld",
+                 (op == DW_OP_deref_type ? "DW_OP_deref_type"
+                                         : "DW_OP_GNU_deref_type"),
+                 (long) uvalue);
          uvalue = read_uleb128 (data, &bytes_read, end);
          data += bytes_read;
          printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue));
          break;
+       case DW_OP_convert:
        case DW_OP_GNU_convert:
          uvalue = read_uleb128 (data, &bytes_read, end);
          data += bytes_read;
-         printf ("DW_OP_GNU_convert <0x%s>",
+         printf ("%s <0x%s>",
+                 (op == DW_OP_convert ? "DW_OP_convert" : "DW_OP_GNU_convert"),
                  dwarf_vmatoa ("x", uvalue ? cu_offset + uvalue : 0));
          break;
+       case DW_OP_reinterpret:
        case DW_OP_GNU_reinterpret:
          uvalue = read_uleb128 (data, &bytes_read, end);
          data += bytes_read;
-         printf ("DW_OP_GNU_reinterpret <0x%s>",
+         printf ("%s <0x%s>",
+                 (op == DW_OP_reinterpret ? "DW_OP_reinterpret"
+                                          : "DW_OP_GNU_reinterpret"),
                  dwarf_vmatoa ("x", uvalue ? cu_offset + uvalue : 0));
          break;
        case DW_OP_GNU_parameter_ref:
@@ -1708,6 +1729,32 @@ read_and_display_attr_value (unsigned long attribute,
       data += 8;
       break;
 
+    case DW_FORM_data16:
+      if (!do_loc)
+       {
+         dwarf_vma left_high_bits, left_low_bits;
+         dwarf_vma right_high_bits, right_low_bits;
+
+         SAFE_BYTE_GET64 (data, &left_high_bits, &left_low_bits, end);
+         SAFE_BYTE_GET64 (data + 8, &right_high_bits, &right_low_bits, end);
+         if (byte_get == byte_get_little_endian)
+           {
+             /* Swap them.  */
+             left_high_bits ^= right_high_bits;
+             right_high_bits ^= left_high_bits;
+             left_high_bits ^= right_high_bits;
+             left_low_bits ^= right_low_bits;
+             right_low_bits ^= left_low_bits;
+             left_low_bits ^= right_low_bits;
+           }
+         printf (" 0x%08" DWARF_VMA_FMT "x%08" DWARF_VMA_FMT "x"
+                 "%08" DWARF_VMA_FMT "x%08" DWARF_VMA_FMT "x",
+                 left_high_bits, left_low_bits, right_high_bits,
+                 right_low_bits);
+       }
+      data += 16;
+      break;
+
     case DW_FORM_string:
       if (!do_loc)
        printf ("%c%.*s", delimiter, (int) (end - data), data);
@@ -1884,9 +1931,13 @@ read_and_display_attr_value (unsigned long attribute,
        case DW_AT_segment:
        case DW_AT_static_link:
        case DW_AT_use_location:
+       case DW_AT_call_value:
        case DW_AT_GNU_call_site_value:
+       case DW_AT_call_data_value:
        case DW_AT_GNU_call_site_data_value:
+       case DW_AT_call_target:
        case DW_AT_GNU_call_site_target:
+       case DW_AT_call_target_clobbered:
        case DW_AT_GNU_call_site_target_clobbered:
          if ((dwarf_version < 4
               && (form == DW_FORM_data4 || form == DW_FORM_data8))
@@ -2160,9 +2211,13 @@ read_and_display_attr_value (unsigned long attribute,
     case DW_AT_segment:
     case DW_AT_static_link:
     case DW_AT_use_location:
+    case DW_AT_call_value:
     case DW_AT_GNU_call_site_value:
+    case DW_AT_call_data_value:
     case DW_AT_GNU_call_site_data_value:
+    case DW_AT_call_target:
     case DW_AT_GNU_call_site_target:
+    case DW_AT_call_target_clobbered:
     case DW_AT_GNU_call_site_target_clobbered:
       if ((dwarf_version < 4
           && (form == DW_FORM_data4 || form == DW_FORM_data8))
@@ -4514,9 +4569,9 @@ display_debug_macro (struct dwarf_section *section,
       unsigned char **extended_ops = NULL;
 
       SAFE_BYTE_GET_AND_INC (version, curr, 2, end);
-      if (version != 4)
+      if (version != 4 && version != 5)
        {
-         error (_("Only GNU extension to DWARF 4 of %s is currently supported.\n"),
+         error (_("Only GNU extension to DWARF 4 or 5 of %s is currently supported.\n"),
                 section->name);
          return 0;
        }
@@ -4553,10 +4608,10 @@ display_debug_macro (struct dwarf_section *section,
                  nargs = read_uleb128 (curr, &bytes_read, end);
                  curr += bytes_read;
                  if (nargs == 0)
-                   printf (_("    DW_MACRO_GNU_%02x has no arguments\n"), op);
+                   printf (_("    DW_MACRO_%02x has no arguments\n"), op);
                  else
                    {
-                     printf (_("    DW_MACRO_GNU_%02x arguments: "), op);
+                     printf (_("    DW_MACRO_%02x arguments: "), op);
                      for (n = 0; n < nargs; n++)
                        {
                          unsigned int form;
@@ -4609,7 +4664,7 @@ display_debug_macro (struct dwarf_section *section,
 
          switch (op)
            {
-           case DW_MACRO_GNU_start_file:
+           case DW_MACRO_start_file:
              {
                unsigned int filenum;
                unsigned char *file_name = NULL, *dir_name = NULL;
@@ -4620,87 +4675,87 @@ display_debug_macro (struct dwarf_section *section,
                curr += bytes_read;
 
                if ((flags & 2) == 0)
-                 error (_("DW_MACRO_GNU_start_file used, but no .debug_line offset provided.\n"));
+                 error (_("DW_MACRO_start_file used, but no .debug_line offset provided.\n"));
                else
                  file_name
                    = get_line_filename_and_dirname (line_offset, filenum,
                                                     &dir_name);
                if (file_name == NULL)
-                 printf (_(" DW_MACRO_GNU_start_file - lineno: %d filenum: %d\n"),
+                 printf (_(" DW_MACRO_start_file - lineno: %d filenum: %d\n"),
                          lineno, filenum);
                else
-                 printf (_(" DW_MACRO_GNU_start_file - lineno: %d filenum: %d filename: %s%s%s\n"),
+                 printf (_(" DW_MACRO_start_file - lineno: %d filenum: %d filename: %s%s%s\n"),
                          lineno, filenum,
                          dir_name != NULL ? (const char *) dir_name : "",
                          dir_name != NULL ? "/" : "", file_name);
              }
              break;
 
-           case DW_MACRO_GNU_end_file:
-             printf (_(" DW_MACRO_GNU_end_file\n"));
+           case DW_MACRO_end_file:
+             printf (_(" DW_MACRO_end_file\n"));
              break;
 
-           case DW_MACRO_GNU_define:
+           case DW_MACRO_define:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              string = curr;
              curr += strnlen ((char *) string, end - string) + 1;
-             printf (_(" DW_MACRO_GNU_define - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_define - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_undef:
+           case DW_MACRO_undef:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              string = curr;
              curr += strnlen ((char *) string, end - string) + 1;
-             printf (_(" DW_MACRO_GNU_undef - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_undef - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_define_indirect:
+           case DW_MACRO_define_strp:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
              string = fetch_indirect_string (offset);
-             printf (_(" DW_MACRO_GNU_define_indirect - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_define_strp - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_undef_indirect:
+           case DW_MACRO_undef_strp:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
              string = fetch_indirect_string (offset);
-             printf (_(" DW_MACRO_GNU_undef_indirect - lineno : %d macro : %s\n"),
+             printf (_(" DW_MACRO_undef_strp - lineno : %d macro : %s\n"),
                      lineno, string);
              break;
 
-           case DW_MACRO_GNU_transparent_include:
+           case DW_MACRO_import:
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_transparent_include - offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_import - offset : 0x%lx\n"),
                      (unsigned long) offset);
              break;
 
-           case DW_MACRO_GNU_define_indirect_alt:
+           case DW_MACRO_define_sup:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_define_indirect_alt - lineno : %d macro offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_define_sup - lineno : %d macro offset : 0x%lx\n"),
                      lineno, (unsigned long) offset);
              break;
 
-           case DW_MACRO_GNU_undef_indirect_alt:
+           case DW_MACRO_undef_sup:
              lineno = read_uleb128 (curr, &bytes_read, end);
              curr += bytes_read;
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_undef_indirect_alt - lineno : %d macro offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_undef_sup - lineno : %d macro offset : 0x%lx\n"),
                      lineno, (unsigned long) offset);
              break;
 
-           case DW_MACRO_GNU_transparent_include_alt:
+           case DW_MACRO_import_sup:
              SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end);
-             printf (_(" DW_MACRO_GNU_transparent_include_alt - offset : 0x%lx\n"),
+             printf (_(" DW_MACRO_import_sup - offset : 0x%lx\n"),
                      (unsigned long) offset);
              break;
 
@@ -4719,10 +4774,10 @@ display_debug_macro (struct dwarf_section *section,
                  desc += bytes_read;
                  if (nargs == 0)
                    {
-                     printf (_(" DW_MACRO_GNU_%02x\n"), op);
+                     printf (_(" DW_MACRO_%02x\n"), op);
                      break;
                    }
-                 printf (_(" DW_MACRO_GNU_%02x -"), op);
+                 printf (_(" DW_MACRO_%02x -"), op);
                  for (n = 0; n < nargs; n++)
                    {
                      int val;