Bug 21889 - Native Solaris assembler cannot grok DTP-relative debug symbols
Summary: Native Solaris assembler cannot grok DTP-relative debug symbols
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.1
Assignee: Eric Botcazou
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch, wrong-debug
Depends on:
Blocks:
 
Reported: 2005-06-02 21:46 UTC by Richard C. Bilson
Modified: 2005-06-11 15:27 UTC (History)
3 users (show)

See Also:
Host: sparc64-sun-solaris2.10
Target: sparc64-sun-solaris2.10
Build: sparc64-sun-solaris2.10
Known to work:
Known to fail:
Last reconfirmed: 2005-06-02 22:11:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard C. Bilson 2005-06-02 21:46:10 UTC
smalltalk=; cat test.c
__thread int x;
smalltalk=; gcc -c test.c
smalltalk=; gcc -g -c test.c
/usr/ccs/bin/as: "/var/tmp//cc09foyk.s", line 75: error: statement syntax
/usr/ccs/bin/as: "/var/tmp//cc09foyk.s", line 75: error: statement syntax
/usr/ccs/bin/as: "/var/tmp//cc09foyk.s", line 75: error: statement syntax

Line 75 of the generated assembly is:
    .xword  %r_tls_dtpoff64(x)

Compiling with -m32 produces something that's equally broken, but with 32
instead of 64.
Comment 1 Eric Botcazou 2005-06-02 22:11:06 UTC
Confirmed with Sun tools.  Workaround is to use -gstabs+ instead of -g.
Comment 2 Eric Botcazou 2005-06-02 22:11:37 UTC
Investigating.
Comment 3 Eric Botcazou 2005-06-03 21:56:13 UTC
> Confirmed with Sun tools.  Workaround is to use -gstabs+ instead of -g.

Or use GNU Binutils (preferably 2.16) of course.
Comment 4 CVS Commits 2005-06-08 05:06:02 UTC
Subject: Bug 21889

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2005-06-08 05:05:48

Modified files:
	gcc            : ChangeLog config.gcc dwarf2out.c system.h 
	                 target-def.h target.h 
	gcc/config/frv : frv-protos.h frv.c frv.h 
	gcc/config/i386: i386-protos.h i386.c i386.h 
	gcc/config/ia64: ia64-protos.h ia64.c ia64.h 
	gcc/config/rs6000: rs6000-protos.h rs6000.c rs6000.h 
	gcc/config/s390: s390-protos.h s390.c s390.h 
	gcc/config/sparc: sol2-gas.h sol2.h sparc-protos.h sparc.c 
	                  sparc.h 
	gcc/doc        : tm.texi 

Log message:
	PR target/21889
	* target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel.
	* target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro.
	(TARGET_ASM_OUT): Add it.
	* doc/tm.texi (Debugging Info): Document it.
	* dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>:
	Test it instead of ASM_OUTPUT_DWARF_DTPREL.
	(loc_descriptor_from_tree_1) <VAR_DECL>: Likewise.
	* system.h: Poison ASM_OUTPUT_DWARF_DTPREL.
	* config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete.
	* config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused.
	(gen_inlined_tls_plt): Remove unused variable MEM.
	(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel.
	* config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete.
	* config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete.
	* config/i386/i386.c (i386_output_dwarf_dtprel): Make static and
	unused.
	(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel.
	* config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete.
	* config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete.
	* config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and
	unused.
	(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel.
	* config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete.
	* config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete.
	* config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and
	unused.
	(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel
	* config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete.
	* config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete.
	* config/s390/s390.c (s390_output_dwarf_dtprel): Make static and
	unused.
	(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel.
	* config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete.
	* config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0.
	(TARGET_GNU_TLS): Define to 1.
	* config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete.
	* config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and
	unused.
	(TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel
	if TARGET_GNU_TLS only.
	* config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete.
	
	* config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last.
	(sparc-*-solaris2*): Likewise on Solaris 7 and up.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9084&r2=2.9085
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?cvsroot=gcc&r1=1.548&r2=1.549
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.598&r2=1.599
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/system.h.diff?cvsroot=gcc&r1=1.257&r2=1.258
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/target-def.h.diff?cvsroot=gcc&r1=1.123&r2=1.124
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/target.h.diff?cvsroot=gcc&r1=1.135&r2=1.136
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/frv/frv-protos.h.diff?cvsroot=gcc&r1=1.26&r2=1.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/frv/frv.c.diff?cvsroot=gcc&r1=1.89&r2=1.90
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/frv/frv.h.diff?cvsroot=gcc&r1=1.64&r2=1.65
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386-protos.h.diff?cvsroot=gcc&r1=1.139&r2=1.140
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.825&r2=1.826
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.h.diff?cvsroot=gcc&r1=1.436&r2=1.437
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64-protos.h.diff?cvsroot=gcc&r1=1.72&r2=1.73
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.c.diff?cvsroot=gcc&r1=1.370&r2=1.371
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.h.diff?cvsroot=gcc&r1=1.200&r2=1.201
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000-protos.h.diff?cvsroot=gcc&r1=1.100&r2=1.101
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.834&r2=1.835
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&r1=1.367&r2=1.368
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/s390/s390-protos.h.diff?cvsroot=gcc&r1=1.70&r2=1.71
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/s390/s390.c.diff?cvsroot=gcc&r1=1.235&r2=1.236
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/s390/s390.h.diff?cvsroot=gcc&r1=1.139&r2=1.140
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-gas.h.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2.h.diff?cvsroot=gcc&r1=1.70&r2=1.71
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc-protos.h.diff?cvsroot=gcc&r1=1.53&r2=1.54
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&r1=1.375&r2=1.376
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.h.diff?cvsroot=gcc&r1=1.285&r2=1.286
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/tm.texi.diff?cvsroot=gcc&r1=1.431&r2=1.432

Comment 5 CVS Commits 2005-06-08 20:45:10 UTC
Subject: Bug 21889

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	ebotcazou@gcc.gnu.org	2005-06-08 20:44:58

Modified files:
	gcc            : ChangeLog 
	gcc/config/sparc: sol2-gas.h sol2.h 

Log message:
	PR target/21889
	* config/sparc/sol2.h (ASM_OUTPUT_DWARF_DTPREL): Undefine.
	* config/sparc/sol2-gas.h (ASM_OUTPUT_DWARF_DTPREL): Redefine.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.284&r2=2.7592.2.285
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-gas.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1&r2=1.1.46.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.69.8.1&r2=1.69.8.2

Comment 6 CVS Commits 2005-06-08 20:53:13 UTC
Subject: Bug 21889

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	ebotcazou@gcc.gnu.org	2005-06-08 20:52:36

Modified files:
	gcc            : ChangeLog 
	gcc/config/sparc: sol2-gas-bi.h sol2.h 

Log message:
	PR target/21889
	* config/sparc/sol2.h (ASM_OUTPUT_DWARF_DTPREL): Undefine.
	* config/sparc/sol2-gas.h (ASM_OUTPUT_DWARF_DTPREL): Redefine.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.876&r2=2.2326.2.877
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2-gas-bi.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.4&r2=1.4.14.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sol2.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.57.4.4&r2=1.57.4.5

Comment 7 Eric Botcazou 2005-06-08 20:56:53 UTC
See http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00478.html