This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 3.4/3.5 PATCH: Switch to DWARF-2 debugging on Solaris/x86 >= 7


Eric Botcazou writes:

> Weird.  I couldn't reproduce the failure this morning with gas 2.14 and Sun 
> ld on Solaris 7 and 8, neither before nor after the patch.  Are you sure you 
> passed --with-gnu-as and not --with-gnu-ld?

Yes:

$ ./xgcc -B./ -v
Reading specs from ./specs
Configured with: /vol/gnu/src/gcc/gcc-dist/configure --prefix=/vol/gcc --with-local-prefix=/vol/gcc --with-gnu-as --with-as=/vol/gcc/lib/gas-2.14 --enable-languages=c++,f77,java,objc --disable-nls
Thread model: posix
gcc version 3.5.0 20040419 (experimental)

I've had a look at the problematic object files and compared what native as
and gas (both 2.14 and 2.14.91) do:

For the native as, the HAVE_AS_DWARF2_DEBUG_LINE test fails and the macro
is undefined.  Btw., the failure happens both because as doesn't understand
the `.file 1 "conftest.s"' (instead of `.file "conftest.s"') syntax and due
to lack of .loc support.  Therefore, gcc emits the .debug_line section
itself.

With gas, the test succeeds and gcc let's gas emit that section.  The ld
error linking libgcc_s.so.1 happens e.g. for _muldi3.o:

ld: fatal: relocation error: R_SPARC_32: file libgcc/./_muldi3.o: symbol <unknown>: offset 0xfeaf7262 is non-aligned

The only R_SPARC_32 relocation in that file, as reported by elfdump -r, is
this one:

Relocation: .rela.debug_line
        type                       offset      addend  section   with respect to
        R_SPARC_32                      0x55          0  .rela.debug_li .text (section)  

Since the whole section and corresponding relocation is generated by gas,
the error seems to be on gas' side.  Do you observe the same relocation in
your bootstrap?  If so, what ld version do you use?

I have

$ what /usr/ccs/bin/ld
/usr/ccs/bin/ld:
        SunOS 5.8 Generic 109147-25 Jun 2003

> Any particular reason not to use the following simpler idiom?
> 
> Index: config.gcc
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
> retrieving revision 1.449
> diff -u -r1.449 config.gcc
> --- config.gcc  17 Apr 2004 02:32:23 -0000      1.449
> +++ config.gcc  21 Apr 2004 20:44:08 -0000
> @@ -1816,7 +1816,7 @@
>         extra_parts="crti.o crtn.o crtbegin.o crtend.o"
>         ;;
>  sparc64-*-solaris2* | sparcv9-*-solaris2*)
> -       tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h"
> +       tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h 
> sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h 
> tm-dwarf2.h"
>         if test x$gnu_ld = xyes; then
>                 tm_file="${tm_file} sparc/sol2-gld.h sparc/sol2-gld-bi.h"
>         fi
> @@ -1855,7 +1855,7 @@
>                 fi
>                 ;;
>         *-*-solaris2.[789] | *-*-solaris2.1[0-9])
> -               tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h"
> +               tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h 
> tm-dwarf2.h"
>                 if test x$gnu_ld = xyes; then
>                         tm_file="${tm_file} sparc/sol2-gld-bi.h"
>                 fi

Not really: too much copy&paste and forgetting that the sparcv9-*-solaris2*
configurations are for Solaris 7+ only anyway.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]