public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][MIPS] Remove TARGET_ASM_FUNCTION_RODATA_SECTION
@ 2021-08-19 12:11 Dragan Mladjenovic
  2021-08-19 16:03 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Dragan Mladjenovic @ 2021-08-19 12:11 UTC (permalink / raw)
  To: gcc-patches

Since 'Remove obsolete IRIX 6.5 support' [1] we only use
gp-relative jump-tables for PIC code. We can fall back to
default behaviour for asm_function_rodata_section.

[1] https://gcc.gnu.org/ml/libstdc++/2012-03/msg00067.html

2018-06-04 Dragan Mladjenovic <dragan.mladjenovic@rt-rk.com>
gcc/

	* config/mips/mips.c (mips_function_rodata_section,
	TARGET_ASM_FUNCTION_RODATA_SECTION): Removed.
---
Tested against mips64-linux-gnu with -mabi=64|32|n32 and
mips-mti-elf with mips32r2.

 gcc/config/mips/mips.c | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 89d1be6cea6..39666d6973f 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -9306,42 +9306,6 @@ mips_select_rtx_section (machine_mode mode, rtx x,
   return default_elf_select_rtx_section (mode, x, align);
 }
 
-/* Implement TARGET_ASM_FUNCTION_RODATA_SECTION.
-
-   The complication here is that, with the combination TARGET_ABICALLS
-   && !TARGET_ABSOLUTE_ABICALLS && !TARGET_GPWORD, jump tables will use
-   absolute addresses, and should therefore not be included in the
-   read-only part of a DSO.  Handle such cases by selecting a normal
-   data section instead of a read-only one.  The logic apes that in
-   default_function_rodata_section.  */
-
-static section *
-mips_function_rodata_section (tree decl, bool)
-{
-  if (!TARGET_ABICALLS || TARGET_ABSOLUTE_ABICALLS || TARGET_GPWORD)
-    return default_function_rodata_section (decl, false);
-
-  if (decl && DECL_SECTION_NAME (decl))
-    {
-      const char *name = DECL_SECTION_NAME (decl);
-      if (DECL_COMDAT_GROUP (decl) && startswith (name, ".gnu.linkonce.t."))
-	{
-	  char *rname = ASTRDUP (name);
-	  rname[14] = 'd';
-	  return get_section (rname, SECTION_LINKONCE | SECTION_WRITE, decl);
-	}
-      else if (flag_function_sections
-	       && flag_data_sections
-	       && startswith (name, ".text."))
-	{
-	  char *rname = ASTRDUP (name);
-	  memcpy (rname + 1, "data", 4);
-	  return get_section (rname, SECTION_WRITE, decl);
-	}
-    }
-  return data_section;
-}
-
 /* Implement TARGET_IN_SMALL_DATA_P.  */
 
 static bool
@@ -22606,8 +22570,6 @@ mips_asm_file_end (void)
 #define TARGET_ASM_FUNCTION_EPILOGUE mips_output_function_epilogue
 #undef TARGET_ASM_SELECT_RTX_SECTION
 #define TARGET_ASM_SELECT_RTX_SECTION mips_select_rtx_section
-#undef TARGET_ASM_FUNCTION_RODATA_SECTION
-#define TARGET_ASM_FUNCTION_RODATA_SECTION mips_function_rodata_section
 
 #undef TARGET_SCHED_INIT
 #define TARGET_SCHED_INIT mips_sched_init
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][MIPS] Remove TARGET_ASM_FUNCTION_RODATA_SECTION
  2021-08-19 12:11 [PATCH][MIPS] Remove TARGET_ASM_FUNCTION_RODATA_SECTION Dragan Mladjenovic
@ 2021-08-19 16:03 ` Jeff Law
  2021-08-21 18:57   ` Dragan Mladjenovic
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2021-08-19 16:03 UTC (permalink / raw)
  To: Dragan Mladjenovic, gcc-patches



On 8/19/2021 6:11 AM, Dragan Mladjenovic wrote:
> Since 'Remove obsolete IRIX 6.5 support' [1] we only use
> gp-relative jump-tables for PIC code. We can fall back to
> default behaviour for asm_function_rodata_section.
>
> [1] https://gcc.gnu.org/ml/libstdc++/2012-03/msg00067.html
>
> 2018-06-04 Dragan Mladjenovic <dragan.mladjenovic@rt-rk.com>
> gcc/
>
> * config/mips/mips.c (mips_function_rodata_section,
> TARGET_ASM_FUNCTION_RODATA_SECTION): Removed.
OK
jeff


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH][MIPS] Remove TARGET_ASM_FUNCTION_RODATA_SECTION
  2021-08-19 16:03 ` Jeff Law
@ 2021-08-21 18:57   ` Dragan Mladjenovic
  0 siblings, 0 replies; 3+ messages in thread
From: Dragan Mladjenovic @ 2021-08-21 18:57 UTC (permalink / raw)
  To: Jeff Law, gcc-patches



From: Jeff Law [mailto:jeffreyalaw@gmail.com] 
Sent: 19 August 2021 18:03
To: Dragan Mladjenovic <OT_Dragan.Mladjenovic@mediatek.com>; gcc-patches@gcc.gnu.org
Cc: Andrew Pinski <pinskia@gmail.com>
Subject: Re: [PATCH][MIPS] Remove TARGET_ASM_FUNCTION_RODATA_SECTION


> On 8/19/2021 6:11 AM, Dragan Mladjenovic wrote:
> > Since 'Remove obsolete IRIX 6.5 support' [1] we only use
> > gp-relative jump-tables for PIC code. We can fall back to
> > default behaviour for asm_function_rodata_section.
> >
> > [1] https://gcc.gnu.org/ml/libstdc++/2012-03/msg00067.html
> >
> > 2018-06-04 Dragan Mladjenovic <dragan.mladjenovic@rt-rk.com>
> > gcc/
> >
> > * config/mips/mips.c (mips_function_rodata_section,
> > TARGET_ASM_FUNCTION_RODATA_SECTION): Removed.
> OK
> jeff

Thanks,

Committed as 304ec0d1d9f177e059e695fbe11d93f99f6f14e0.

Dragan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-21 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 12:11 [PATCH][MIPS] Remove TARGET_ASM_FUNCTION_RODATA_SECTION Dragan Mladjenovic
2021-08-19 16:03 ` Jeff Law
2021-08-21 18:57   ` Dragan Mladjenovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).