Re: [PATCH] new support for PPC64 architecture

Daniel Jacobowitz
2003-05-07T20:46:10Z

On Wed, May 07, 2003 at 04:42:27PM -0400, Elena Zannoni wrote:
> Will Schmidt writes:
> > All,
> >
> > This patch contains code that provides support for GDB on the PPC64
> > architecture. This patch will apply clean on top of the RedHat
> > gdb-5.3post-0.20021129.29.src.rpm. (A patch against CVS will
> > happen, but not today.. )
> >
> >
> > (See attached file: gdb-5.3post-ppc64-support.patch)
> >
> >
> > -Will
> >
> >
> > Will Schmidt
> > willschm@us.ibm.com will_schmidt@vnet.ibm.com
> > Linux on PowerPC-64 Development
> > IBM Rochester
>
> A few comments/questions. You need changelogs, and the proper
> copyright verbiage in the new files you are adding. The code needs to
> conform to gnu coding standards as fas as spaces, indentation,
> etc. You can run the new files through gdb_indent.sh to get the right
> format. Comments should start with a capital letter, be full
> sentences, and end with a period followed by 2 spaces.
>
> see below.....
>
> diff -rupPN gdb-5.2.1/gdb/config/powerpc/ppc64linux.mh src.ppc64/gdb/config/powerpc/ppc64linux.mh
> --- gdb-5.2.1/gdb/config/powerpc/ppc64linux.mh 1969-12-31 18:00:00.000000000 -0600
> +++ src.ppc64/gdb/config/powerpc/ppc64linux.mh 2003-03-05 13:00:33.000000000 -0600
> @@ -0,0 +1,14 @@
> +# Host: PowerPC, running Linux
> +
> +XM_FILE= xm-linux.h
> +XM_CLIBS=
> +
> +NAT_FILE= nm-linux.h
> +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
> + core-regset.o ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \
> + gcore.o ppc-sysv-tdep.o
> +
>
> this is the host makefile fragment, the *tdep.o files should be
> included in the target makefile fragment, the .mt file, not here.
> Actually if you exclude the .o's that ashould really be in the mt
> file, then this file becomes almost identical to the linux.mh
> file. Which makes me wonder if we really need a new file.
>
> +LOADLIBES = -ldl -lthread_db
> +
>
> Why include thread_db? I don't see any other config files doing that.
>
> +GDBSERVER_DEPFILES= low-linux.o
>
> it is linux-low.o
>
> +GDBSERVER_LIBS= -lnss_dns -lnss_files -lresolv

Actually, those lines are obsolete. It's on my list to go through and
remove them all so people don't keep copying them.

> diff -rupPN gdb-5.2.1/gdb/elfread.c src.ppc64/gdb/elfread.c
> --- gdb-5.2.1/gdb/elfread.c 2002-03-25 10:50:20.000000000 -0600
> +++ src.ppc64/gdb/elfread.c 2003-01-28 13:28:24.000000000 -0600
> @@ -154,6 +154,12 @@ record_minimal_symbol_and_info (char *na
> if (ms_type == mst_text || ms_type == mst_file_text)
> address = SMASH_TEXT_ADDRESS (address);
>
> +#ifdef DROP_TEXT_NAME_PREFIX_CHAR
> + if ((ms_type == mst_text || ms_type == mst_file_text)
> + && name[0] == DROP_TEXT_NAME_PREFIX_CHAR)
> + ++name;
> +#endif /* DROP_TEXT_NAME_PREFIX_CHAR */
> +
>
>
> can you explain why this is needed? Do we really have names starting
> with '.', using gcc?

This is a peculiarity of the PPC64 ABI, also related to the OPD macros.
Global functions have two symbols: 'foo' and '.foo'. One of them is
an address and the other is a descriptor with the function's gp value,
IIRC.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer