public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, rs6000] Add ppc64_linux_gcc_target_options method
@ 2021-07-27 15:35 will schmidt
  2021-07-29  7:16 ` Ulrich Weigand
  2021-07-30 13:52 ` Tom Tromey
  0 siblings, 2 replies; 6+ messages in thread
From: will schmidt @ 2021-07-27 15:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Ulrich Weigand, rogerio, Carl E. Love

[gdb] [rs6000] Add ppc64_linux_gcc_target_options method.
    
Hi,
 Add a method to set the gcc target options for powerpc.
This change explicitly sets mcmodel=medium, which matches the gcc
default setting for this target; versus the -mcmodel=large
setting which is set by default_gcc_target_options.
    
OK for trunk?
Thanks
-Will
    
gdb/Changelog:
	yyyy-mm-dd  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* gdb/rs6000-tdep.c (linux_gcc_target_options): New method.
	(rs6000_gdbarch_init):  Hook in the new method.

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 826f0266ed8..a14366e778b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -822,10 +822,17 @@ rs6000_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   return rs6000_in_function_epilogue_frame_p (get_current_frame (),
 					      gdbarch, pc);
 }
 
+/* Implement the linux_gcc_target_options method.  */
+static std::string
+ppc64_linux_gcc_target_options (struct gdbarch *gdbarch)
+{
+        return "-mcmodel=medium";
+}
+
 /* Get the ith function argument for the current function.  */
 static CORE_ADDR
 rs6000_fetch_pointer_argument (struct frame_info *frame, int argi, 
 			       struct type *type)
 {
@@ -7129,10 +7136,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Trampoline.  */
   set_gdbarch_in_solib_return_trampoline
     (gdbarch, rs6000_in_solib_return_trampoline);
   set_gdbarch_skip_trampoline_code (gdbarch, rs6000_skip_trampoline_code);
 
+  /* Set GCC target options.  */
+  set_gdbarch_gcc_target_options (gdbarch, ppc64_linux_gcc_target_options);
+
   /* Hook in the DWARF CFI frame unwinder.  */
   dwarf2_append_unwinders (gdbarch);
   dwarf2_frame_set_adjust_regnum (gdbarch, rs6000_adjust_frame_regnum);
 
   /* Frame handling.  */


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

end of thread, other threads:[~2021-08-16 12:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 15:35 [PATCH, rs6000] Add ppc64_linux_gcc_target_options method will schmidt
2021-07-29  7:16 ` Ulrich Weigand
2021-08-03 18:56   ` will schmidt
2021-07-30 13:52 ` Tom Tromey
2021-08-05 20:43   ` [PATCH, rs6000] [V2] " will schmidt
2021-08-16 12:12     ` Ulrich Weigand

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).