[PATCH] DWARF support for AIX v4

Richard Henderson rth@redhat.com
Thu Sep 24 18:32:00 GMT 2015


On 09/23/2015 07:39 PM, David Edelsohn wrote:
> Richard and Richard,
> 
> Appended is the updated version of the DWARF support patch for AIX.  I
> still can split out the length computation into a separate helper
> function, but, as I mentioned, it won't apply to the instance that
> uses a delta of two labels.
> 
> This version sets have_macinfo to False and disables add_AT_loc_list.
> It also define XCOFF_DEBUGGING_INFO to 0 by default in dwarf2out.c and
> dwarf2asm.c.
> 
> Thanks, David
> 
>         * dwarf2out.c (XCOFF_DEBUGGING_INFO): Default 0 definition.
>         (have_macinfo): Force to False for XCOFF_DEBUGGING_INFO.
>         (add_AT_loc_list): Return early if XCOFF_DEBUGGING_INFO.
>         (output_compilation_unit_header): Don't output length on AIX.
>         (output_pubnames): Don't output length on AIX.
>         (output_aranges): Delete argument. Compute length locally. Don't
>         output length on AIX.
>         (output_line_info): Don't output length on AIX.
>         (dwarf2out_finish): Don't compute aranges_length.
>         * dwarf2asm.c (XCOFF_DEBUGGING_INFO): Default 0 definition.
>         (dw2_asm_output_nstring): Emit .byte not .ascii on AIX.
>         * config/rs6000/rs6000.c (rs6000_output_dwrf_dtprel): Emit correct
>         symbol decoration for AIX.
>         (rs6000_xcoff_debug_unwind_info): New.
>         (rs6000_xcoff_asm_named_section): Emit .dwsect pseudo-op
>         for SECTION_DEBUG.
>         (rs6000_xcoff_declare_function_name): Emit different
>         .function pseudo-op when DWARF2_DEBUG. Don't call
>         xcoffout_declare_function for DWARF2_DEBUG.
>         * config/rs6000/xcoff.h (TARGET_DEBUG_UNWIND_INFO):
>         Redefine.
>         * config/rs6000/aix71.h (DWARF2_DEBUGGING_INFO): Define.
>         (PREFERRED_DEBUGGING_TYPE): Define.
>         (DEBUG_INFO_SECTION): Define.
>         (DEBUG_ABBREV_SECTION): Define.
>         (DEBUG_ARANGES_SECTION): Define.
>         (DEBUG_LINE_SECTION): Define.
>         (DEBUG_PUBNAMES_SECTION): Define.
>         (DEBUG_PUBTYPES_SECTION): Define.
>         (DEBUG_STR_SECTION): Define.
>         (DEBUG_RANGES_SECTION): Define.

Ok.

> +  else if (TARGET_XCOFF && GET_CODE (x) == SYMBOL_REF
> +          && SYMBOL_REF_TLS_MODEL (x) != 0)
> +    {
> +      if (SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_EXEC)
> +       fputs ("@le", file);
> +      else if (SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_INITIAL_EXEC)
> +       fputs ("@ie", file);
> +      else if (SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_GLOBAL_DYNAMIC
> +              || SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
> +       fputs ("@m", file);
> +    }

FWIW, I would have written this:


    else if (TARGET_XCOFF && GET_CODE (x) == SYMBOL_REF)
      {
        switch (SYMBOL_REF_TLS_MODEL (x))
          {
          case 0:
            break;
          case TLS_MODEL_LOCAL_EXEC:
            fputs ("@le", file);
            break;
          case TLS_MODEL_INITIAL_EXEC:
            fputs ("@ie", file);
            break;
          case TLS_MODEL_GLOBAL_DYNAMIC:
          case TLS_MODEL_LOCAL_DYNAMIC:
            fputs ("@m", file);
            break;
          default:
            gcc_unreachable ();
          }
      }


r~



More information about the Gcc-patches mailing list