Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: hjl.tools@gmail.com
Cc: gdb-patches@sourceware.org
Subject: Re: PATCH: Check bfd_mach_x64_32 to set tdesc for x32 binary
Date: Fri, 11 May 2012 20:20:00 -0000	[thread overview]
Message-ID: <201205112020.q4BKKAbT010335@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20120511192949.GA5070@intel.com> (hongjiu.lu@intel.com)

> Hi,
> 
> This patch checks bfd_mach_x64_32 to set tdesc for x32 binary.  Tested
> on Linux/x86-64.  OK to install?
> 
> Thanks.
> 
> 
> H.J.
> ---
> 	* amd64-linux-tdep.c: Include features/i386/x32-linux.c
> 	and features/i386/x32-avx-linux.c.
> 	(amd64_linux_init_abi): Check bfd_mach_x64_32 for x32 process.
> 	(_initialize_amd64_linux_tdep): Register bfd_mach_x64_32.  Call
> 	initialize_tdesc_x32_linux and initialize_tdesc_x32_avx_linux.
> 
> 	* amd64-linux-tdep.h (tdesc_x32_linux): New.
> 	(tdesc_x32_avx_linux): Likewise.
> 
> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
> index acc7303..601ce20 100644
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
> @@ -1545,8 +1578,12 @@ _initialize_amd64_linux_tdep (void)
>  {
>    gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
>  			  GDB_OSABI_LINUX, amd64_linux_init_abi);
> +  gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x64_32,
> +			  GDB_OSABI_LINUX, amd64_linux_init_abi);

Instead of doing this, you should introduce an
amd64_x32_linux_init_abi() function, make that call amd64_linix_init_abi() and ovverride the bits that are different for X32.


  reply	other threads:[~2012-05-11 20:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 19:30 H.J. Lu
2012-05-11 20:20 ` Mark Kettenis [this message]
2012-05-11 23:13   ` H.J. Lu
2012-05-14 18:10     ` H.J. Lu
2012-05-14 18:42     ` Mark Kettenis
2012-05-14 19:02       ` H.J. Lu
2012-05-11 20:31 ` Mark Kettenis
2012-05-11 20:56   ` H.J. Lu
2012-05-12  1:38 ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201205112020.q4BKKAbT010335@glazunov.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox