🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52275

gcc-2.3.2 C++ compile with -g gives undefined symbol

#52275
From: The Duck
Date: Tue, 08 Dec 1992 23:15
698 lines
16761 bytes
Version:       2.3.2 (happened on 2.3.1, too)
Configuration: --target=i386-sysv4
O/S:           V.4 UnixWare (really USL's Destiny)
H/W:           various 486 machines
Summary:       compiling C++ programs with -g generates
			   undefined symbol .L_T51


Even with the simplest C++ program, gcc generates a reference to 
an undefined symbol .L_T51 if compiling with -g.  Interestingly enough, 
even when compiling more complicated programs, the undefined symbol
is still .L_T51.  

Included below is:
	- the source file
	- a compilation showing the error from as.
	- a compilation with -S to generate file.s, and
	- file.s itself. Note that .L_T51 only appears once.
	  (sorry about the length, but I thought it would be helpful
	  to find the problem)

Any help greatly appreciated.
--Duck
duck@univel.com


(I've inserted newlines in over-long lines)

> cat file.C
int fubar;

> gcc -v  -g  file.C
Reading specs from /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/specs
gcc version 2.3.2
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cpp -lang-c++ -v -undef -D__GNUC__=2
  -D__GNUG__=2 -D__cplusplus -Di386 -Dunix -D__svr4__ -D__i386__ -D__unix__
  -D__svr4__ -D__i386 -D__unix -D__svr4__ -Asystem(unix) -Acpu(i386)
  -Amachine(i386) -g file.C /var/tmp/cca004zm.i
GNU CPP version 2.3.2 (i386 System V Release 4)
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cc1plus /var/tmp/cca004zm.i -quiet
  -dumpbase file.cc -g -version -o /var/tmp/cca004zm.s
GNU C++ version 2.3.2 (i386 System V Release 4) compiled by GNU C version 2.3.2.
 /usr/ccs/bin/as -V -Qy -o /var/tmp/cca004zm1.o /var/tmp/cca004zm.s
as: Optimizing C Compilation System  (CCS) 2.0  10/30/92 
(EOF):undefined name: .L_T51
gcc: /var/tmp/cca004zm1.o: No such file or directory


>  gcc -v  -g  -S file.C
Reading specs from /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/specs
gcc version 2.3.2
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cpp -lang-c++ -v -undef -D__GNUC__=2
  -D__GNUG__=2 -D__cplusplus -Di386 -Dunix -D__svr4__ -D__i386__ -D__unix__
  -D__svr4__ -D__i386 -D__unix -D__svr4__ -Asystem(unix) -Acpu(i386)
  -Amachine(i386) -g file.C /var/tmp/cca004zq.i
GNU CPP version 2.3.2 (i386 System V Release 4)
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cc1plus /var/tmp/cca004zq.i -quiet
  -dumpbase file.cc -g -version -o file.s
GNU C++ version 2.3.2 (i386 System V Release 4) compiled by GNU C version 2.3.2.

> cat file.s
        .file   "file.C"
        .version        "01.01"
gcc2_compiled.:

section        .text
L_text_b:
        .previous

section        .data
L_data_b:
        .previous

section        .rodata
L_rodata_b:
        .previous

section        .bss
L_bss_b:
        .previous

section        .debug_sfnames
L_sfnames_b:
        .string "/home/duck/g++/"
        .previous

section        .line
L_line_b:
        .4byte  .L_line_e-.L_line_b
        .4byte  .L_text_b
        .previous

section        .debug_srcinfo
L_srcinfo_b:
        .4byte  .L_line_b
        .4byte  .L_sfnames_b
        .4byte  .L_text_b
        .4byte  .L_text_e
        .4byte  0xffffffff
        .previous

section        .debug_pubnames
        .4byte  .L_debug_b
        .previous

section        .debug_aranges
        .4byte  .L_debug_b
        .previous

section        .debug
L_debug_b:
L_D1:
        .4byte  .L_D1_e-.L_D1
        .2byte  0x11
        .2byte  0x12
        .4byte  .L_D2
        .2byte  0x38
        .string "file.C"
        .2byte  0x258
        .string "GNU C++ 2.3.2"
        .2byte  0x136
        .4byte  0x4
        .2byte  0x111
        .4byte  .L_text_b
        .2byte  0x121
        .4byte  .L_text_e
        .2byte  0x106
        .4byte  .L_line_b
        .2byte  0x1b8
        .string "/home/duck/g++"
        .2byte  0x8006
        .4byte  .L_sfnames_b
        .2byte  0x8016
        .4byte  .L_srcinfo_b
L_D1_e:
        .previous


section        .debug
L_D3:
        .4byte  .L_D3_e-.L_D3
        .2byte  0x16
        .2byte  0x12
        .4byte  .L_D4
        .2byte  0x38
        .string "unknown type"
        .2byte  0x72
        .4byte  .L_T51
L_D3_e:
        .previous

section        .debug
L_D4:
        .4byte  .L_D4_e-.L_D4
        .2byte  0x13
        .2byte  0x12
        .4byte  .L_D5
        .set    .L_T56,.L_D4
        .2byte  0xb6
        .4byte  0x8
L_D4_e:
L_D6:
        .4byte  .L_D6_e-.L_D6
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D7
        .2byte  0x38
        .string "delta"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x55
        .2byte  0x4
        .2byte  0x23
        .2byte  .L_l6_e-.L_l6
L_l6:
        .byte   0x4
        .4byte  0x0
        .byte   0x7
L_l6_e:
L_D6_e:
L_D7:
        .4byte  .L_D7_e-.L_D7
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D8
        .2byte  0x38
        .string "index"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x55
        .2byte  0x4
        .2byte  0x23
        .2byte  .L_l7_e-.L_l7
L_l7:
        .byte   0x4
        .4byte  0x2
        .byte   0x7
L_l7_e:
L_D7_e:
L_D8:
        .4byte  .L_D8_e-.L_D8
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D9
        .2byte  0x38
        .string "pfn"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x63
        .2byte  .L_t8_e-.L_t8
L_t8:
        .byte   0x1
        .2byte  0x14
L_t8_e:
        .2byte  0x23
        .2byte  .L_l8_e-.L_l8
L_l8:
        .byte   0x4
        .4byte  0x4
        .byte   0x7
L_l8_e:
L_D8_e:
L_D9:
        .4byte  .L_D9_e-.L_D9
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D10
        .2byte  0x38
        .string "delta2"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x55
        .2byte  0x4
        .2byte  0x23
        .2byte  .L_l9_e-.L_l9
L_l9:
        .byte   0x4
        .4byte  0x4
        .byte   0x7
L_l9_e:
L_D9_e:
L_D10:
        .4byte  0x4
L_D5:
        .4byte  .L_D5_e-.L_D5
        .2byte  0x16
        .2byte  0x12
        .4byte  .L_D11
        .2byte  0x38
        .string ".vtbl_ptr_type"
        .2byte  0x83
        .2byte  .L_t5_e-.L_t5
L_t5:
        .byte   0x3
        .4byte  .L_T56
L_t5_e:
L_D5_e:
        .previous
        .comm   fubar,4,4

section        .debug_pubnames
        .4byte  .L_P0
        .string "fubar"
        .previous

section        .debug_aranges
        .4byte  fubar
        .4byte  0x4
        .previous

section        .debug
L_P0:
L_D11:
        .4byte  .L_D11_e-.L_D11
        .2byte  0x7
        .2byte  0x12
        .4byte  .L_D12
        .2byte  0x38
        .string "fubar"
        .2byte  0x55
        .2byte  0x7
        .2byte  0x23
        .2byte  .L_l11_e-.L_l11
L_l11:
        .byte   0x3
        .4byte  fubar
L_l11_e:
L_D11_e:
        .previous

section        .debug
L_D12:
        .4byte  .L_D12_e-.L_D12
        .align 4
L_D12_e:
L_D2:
        .previous

section        .text
L_text_e:
        .previous

section        .data
L_data_e:
        .previous

section        .rodata
L_rodata_e:
        .previous

section        .bss
L_bss_e:
        .previous

section        .line
L_line_last:
        .4byte  0x0
        .2byte  0xffff
        .4byte  .L_text_e-.L_text_b
L_line_e:
        .previous

section        .debug_srcinfo
        .4byte  .L_line_last-.L_line_b
        .4byte  0xffffffff
        .previous

section        .debug_pubnames
        .4byte  0x0
        .string ""
        .previous

section        .debug_aranges
        .4byte  .L_text_b
        .4byte  .L_text_e-.L_text_b
        .4byte  .L_data_b
        .4byte  .L_data_e-.L_data_b
        .4byte  .L_rodata_b
        .4byte  .L_rodata_e-.L_rodata_b
        .4byte  .L_bss_b
        .4byte  .L_bss_e-.L_bss_b
        .4byte  0x0
        .4byte  0x0
        .previous
        .ident  "GCC: (GNU) 2.3.2"
> 
 C++ compile with -g gives undefined symbol
Reply-To: duck@univel.COM


Version:       2.3.2 (happened on 2.3.1, too)
Configuration: --target=i386-sysv4
O/S:           V.4 UnixWare (really USL's Destiny)
H/W:           various 486 machines
Summary:       compiling C++ programs with -g generates
			   undefined symbol .L_T51


Even with the simplest C++ program, gcc generates a reference to 
an undefined symbol .L_T51 if compiling with -g.  Interestingly enough, 
even when compiling more complicated programs, the undefined symbol
is still .L_T51.  

Included below is:
	- the source file
	- a compilation showing the error from as.
	- a compilation with -S to generate file.s, and
	- file.s itself. Note that .L_T51 only appears once.
	  (sorry about the length, but I thought it would be helpful
	  to find the problem)

Any help greatly appreciated.
--Duck
duck@univel.com


(I've inserted newlines in over-long lines)

> cat file.C
int fubar;

> gcc -v  -g  file.C
Reading specs from /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/specs
gcc version 2.3.2
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cpp -lang-c++ -v -undef -D__GNUC__=2
  -D__GNUG__=2 -D__cplusplus -Di386 -Dunix -D__svr4__ -D__i386__ -D__unix__
  -D__svr4__ -D__i386 -D__unix -D__svr4__ -Asystem(unix) -Acpu(i386)
  -Amachine(i386) -g file.C /var/tmp/cca004zm.i
GNU CPP version 2.3.2 (i386 System V Release 4)
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cc1plus /var/tmp/cca004zm.i -quiet
  -dumpbase file.cc -g -version -o /var/tmp/cca004zm.s
GNU C++ version 2.3.2 (i386 System V Release 4) compiled by GNU C version  
2.3.2.
 /usr/ccs/bin/as -V -Qy -o /var/tmp/cca004zm1.o /var/tmp/cca004zm.s
as: Optimizing C Compilation System  (CCS) 2.0  10/30/92 
(EOF):undefined name: .L_T51
gcc: /var/tmp/cca004zm1.o: No such file or directory


>  gcc -v  -g  -S file.C
Reading specs from /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/specs
gcc version 2.3.2
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cpp -lang-c++ -v -undef -D__GNUC__=2
  -D__GNUG__=2 -D__cplusplus -Di386 -Dunix -D__svr4__ -D__i386__ -D__unix__
  -D__svr4__ -D__i386 -D__unix -D__svr4__ -Asystem(unix) -Acpu(i386)
  -Amachine(i386) -g file.C /var/tmp/cca004zq.i
GNU CPP version 2.3.2 (i386 System V Release 4)
 /usr/local/lib/gcc-lib/i386-sysv4/2.3.2/cc1plus /var/tmp/cca004zq.i -quiet
  -dumpbase file.cc -g -version -o file.s
GNU C++ version 2.3.2 (i386 System V Release 4) compiled by GNU C version  
2.3.2.

> cat file.s
        .file   "file.C"
        .version        "01.01"
gcc2_compiled.:

section        .text
L_text_b:
        .previous

section        .data
L_data_b:
        .previous

section        .rodata
L_rodata_b:
        .previous

section        .bss
L_bss_b:
        .previous

section        .debug_sfnames
L_sfnames_b:
        .string "/home/duck/g++/"
        .previous

section        .line
L_line_b:
        .4byte  .L_line_e-.L_line_b
        .4byte  .L_text_b
        .previous

section        .debug_srcinfo
L_srcinfo_b:
        .4byte  .L_line_b
        .4byte  .L_sfnames_b
        .4byte  .L_text_b
        .4byte  .L_text_e
        .4byte  0xffffffff
        .previous

section        .debug_pubnames
        .4byte  .L_debug_b
        .previous

section        .debug_aranges
        .4byte  .L_debug_b
        .previous

section        .debug
L_debug_b:
L_D1:
        .4byte  .L_D1_e-.L_D1
        .2byte  0x11
        .2byte  0x12
        .4byte  .L_D2
        .2byte  0x38
        .string "file.C"
        .2byte  0x258
        .string "GNU C++ 2.3.2"
        .2byte  0x136
        .4byte  0x4
        .2byte  0x111
        .4byte  .L_text_b
        .2byte  0x121
        .4byte  .L_text_e
        .2byte  0x106
        .4byte  .L_line_b
        .2byte  0x1b8
        .string "/home/duck/g++"
        .2byte  0x8006
        .4byte  .L_sfnames_b
        .2byte  0x8016
        .4byte  .L_srcinfo_b
L_D1_e:
        .previous


section        .debug
L_D3:
        .4byte  .L_D3_e-.L_D3
        .2byte  0x16
        .2byte  0x12
        .4byte  .L_D4
        .2byte  0x38
        .string "unknown type"
        .2byte  0x72
        .4byte  .L_T51
L_D3_e:
        .previous

section        .debug
L_D4:
        .4byte  .L_D4_e-.L_D4
        .2byte  0x13
        .2byte  0x12
        .4byte  .L_D5
        .set    .L_T56,.L_D4
        .2byte  0xb6
        .4byte  0x8
L_D4_e:
L_D6:
        .4byte  .L_D6_e-.L_D6
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D7
        .2byte  0x38
        .string "delta"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x55
        .2byte  0x4
        .2byte  0x23
        .2byte  .L_l6_e-.L_l6
L_l6:
        .byte   0x4
        .4byte  0x0
        .byte   0x7
L_l6_e:
L_D6_e:
L_D7:
        .4byte  .L_D7_e-.L_D7
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D8
        .2byte  0x38
        .string "index"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x55
        .2byte  0x4
        .2byte  0x23
        .2byte  .L_l7_e-.L_l7
L_l7:
        .byte   0x4
        .4byte  0x2
        .byte   0x7
L_l7_e:
L_D7_e:
L_D8:
        .4byte  .L_D8_e-.L_D8
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D9
        .2byte  0x38
        .string "pfn"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x63
        .2byte  .L_t8_e-.L_t8
L_t8:
        .byte   0x1
        .2byte  0x14
L_t8_e:
        .2byte  0x23
        .2byte  .L_l8_e-.L_l8
L_l8:
        .byte   0x4
        .4byte  0x4
        .byte   0x7
L_l8_e:
L_D8_e:
L_D9:
        .4byte  .L_D9_e-.L_D9
        .2byte  0xd
        .2byte  0x12
        .4byte  .L_D10
        .2byte  0x38
        .string "delta2"
        .2byte  0x142
        .4byte  .L_T56
        .2byte  0x55
        .2byte  0x4
        .2byte  0x23
        .2byte  .L_l9_e-.L_l9
L_l9:
        .byte   0x4
        .4byte  0x4
        .byte   0x7
L_l9_e:
L_D9_e:
L_D10:
        .4byte  0x4
L_D5:
        .4byte  .L_D5_e-.L_D5
        .2byte  0x16
        .2byte  0x12
        .4byte  .L_D11
        .2byte  0x38
        .string ".vtbl_ptr_type"
        .2byte  0x83
        .2byte  .L_t5_e-.L_t5
L_t5:
        .byte   0x3
        .4byte  .L_T56
L_t5_e:
L_D5_e:
        .previous
        .comm   fubar,4,4

section        .debug_pubnames
        .4byte  .L_P0
        .string "fubar"
        .previous

section        .debug_aranges
        .4byte  fubar
        .4byte  0x4
        .previous

section        .debug
L_P0:
L_D11:
        .4byte  .L_D11_e-.L_D11
        .2byte  0x7
        .2byte  0x12
        .4byte  .L_D12
        .2byte  0x38
        .string "fubar"
        .2byte  0x55
        .2byte  0x7
        .2byte  0x23
        .2byte  .L_l11_e-.L_l11
L_l11:
        .byte   0x3
        .4byte  fubar
L_l11_e:
L_D11_e:
        .previous

section        .debug
L_D12:
        .4byte  .L_D12_e-.L_D12
        .align 4
L_D12_e:
L_D2:
        .previous

section        .text
L_text_e:
        .previous

section        .data
L_data_e:
        .previous

section        .rodata
L_rodata_e:
        .previous

section        .bss
L_bss_e:
        .previous

section        .line
L_line_last:
        .4byte  0x0
        .2byte  0xffff
        .4byte  .L_text_e-.L_text_b
L_line_e:
        .previous

section        .debug_srcinfo
        .4byte  .L_line_last-.L_line_b
        .4byte  0xffffffff
        .previous

section        .debug_pubnames
        .4byte  0x0
        .string ""
        .previous

section        .debug_aranges
        .4byte  .L_text_b
        .4byte  .L_text_e-.L_text_b
        .4byte  .L_data_b
        .4byte  .L_data_e-.L_data_b
        .4byte  .L_rodata_b
        .4byte  .L_rodata_e-.L_rodata_b
        .4byte  .L_bss_b
        .4byte  .L_bss_e-.L_bss_b
        .4byte  0x0
        .4byte  0x0
        .previous
        .ident  "GCC: (GNU) 2.3.2"
> 
Technical Details
Message-ID: <1992Dec8.231550.23392@univel.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!world!eff!news.byu.edu!ux1!fcom.cc.utah.edu!gateway.univel.com!news

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,2c5fc52ed1cd737d,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-12-08 16:36:15 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!world!eff!news.byu.edu!ux1!fcom.cc.utah.edu!gateway.univel.com!news
From: duck@univel.COM  (The Duck)
Subject: gcc-2.3.2 C++ compile with -g gives undefined symbol
Message-ID: <1992Dec8.231550.23392@univel.com>
Sender: news@univel.com
Nntp-Posting-Host: pinhead.utah.univel.com
Organization: univel (a partnership of Novell and USL)
Date: Tue, 8 Dec 1992 23:15:50 GMT
Lines: 698