Hi!
On Mon, Oct 25, 2021 at 03:36:25PM +0200, Martin Liška wrote:
> --- a/gcc/config/rs6000/rs6000-internal.h
> +++ b/gcc/config/rs6000/rs6000-internal.h
> @@ -189,4 +189,13 @@ extern bool rs6000_passes_vector;
> extern bool rs6000_returns_struct;
> extern bool cpu_builtin_p;
>
> +struct rs6000_asm_out_state : public asm_out_state
> +{
> + /* Initialize ELF sections. */
> + void init_elf_sections ();
> +
> + /* Initialize XCOFF sections. */
> + void init_xcoff_sections ();
> +};
Our coding convention says to use "class", not "struct" (since this
isn't valid C code at all).
> - sdata2_section
> + sec.sdata2
> = get_unnamed_section (SECTION_WRITE, output_section_asm_op,
> SDATA2_SECTION_ASM_OP);
(broken indentation)
> +/* Implement TARGET_ASM_INIT_SECTIONS. */
That comment is out-of-date.
> +static asm_out_state *
> +rs6000_elf_asm_init_sections (void)
> +{
> + rs6000_asm_out_state *target_state
> + = new (ggc_alloc<rs6000_asm_out_state> ()) rs6000_asm_out_state ();
Hrm, maybe we can have a macro or function that does this, ggc_new or
something?
> +/* Implement TARGET_ASM_INIT_SECTIONS. */
> +
> +static asm_out_state *
> +rs6000_xcoff_asm_init_sections (void)
Here, too. Both implementations are each one of several functions that
together implement the target macro.
> + /* The section that holds the DWARF2 frame unwind information, when
> known.
> + The section is set either by the target's init_sections hook or by the
> + first call to switch_to_eh_frame_section. */
> + section *eh_frame;
> +
> + /* RS6000 sections. */
Nothing here? Just remove the comment header?
The idea looks fine to me.
Segher