public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Go patch committed: Always put immutable structs in unique section
@ 2013-08-06  9:20 Uros Bizjak
  2013-08-06 16:42 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Uros Bizjak @ 2013-08-06  9:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

Hello!

Patch [1] or [2] introduce following warning on alpha:

/space/uros/gcc-build/gcc/testsuite/go2/../../gccgo
-B/space/uros/gcc-build/gcc/testsuite/go2/../../
/home/uros/gcc-svn/trunk/gcc/testsuite/go.test/test/cmplxdivide.go
/home/uros/gcc-svn/trunk/gcc/testsuite/go.test/test/cmplxdivide1.go
-fno-diagnostics-show-caret -fdiagnostics-color=never
-I/space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libgo
-pedantic-errors
-L/space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libgo
-L/space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libgo/.libs  -lm
  -o ./cmplxdivide.o

cmplxdivide.s: Assembler messages:
cmplxdivide.s:357: Warning: setting incorrect section attributes for
.rodata.__go_tdn_main.Test
cmplxdivide.o: file not recognized: File truncated
collect2: error: ld returned 1 exit status

The warning can be fixed If I manually change section attribute of the
above mentioned section from "aw" to "a" in the attached source.

[1] http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00103.html
[2] http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00099.html

Uros.

[-- Attachment #2: cmplxdivide.s.bz2 --]
[-- Type: application/x-bzip2, Size: 84089 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Go patch committed: Always put immutable structs in unique section
  2013-08-06  9:20 Go patch committed: Always put immutable structs in unique section Uros Bizjak
@ 2013-08-06 16:42 ` Ian Lance Taylor
  2013-08-07 10:39   ` Uros Bizjak
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2013-08-06 16:42 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

On Tue, Aug 6, 2013 at 2:20 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> Patch [1] or [2] introduce following warning on alpha:
>
> /space/uros/gcc-build/gcc/testsuite/go2/../../gccgo
> -B/space/uros/gcc-build/gcc/testsuite/go2/../../
> /home/uros/gcc-svn/trunk/gcc/testsuite/go.test/test/cmplxdivide.go
> /home/uros/gcc-svn/trunk/gcc/testsuite/go.test/test/cmplxdivide1.go
> -fno-diagnostics-show-caret -fdiagnostics-color=never
> -I/space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libgo
> -pedantic-errors
> -L/space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libgo
> -L/space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libgo/.libs  -lm
>   -o ./cmplxdivide.o
>
> cmplxdivide.s: Assembler messages:
> cmplxdivide.s:357: Warning: setting incorrect section attributes for
> .rodata.__go_tdn_main.Test
> cmplxdivide.o: file not recognized: File truncated
> collect2: error: ld returned 1 exit status
>
> The warning can be fixed If I manually change section attribute of the
> above mentioned section from "aw" to "a" in the attached source.
>
> [1] http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00103.html
> [2] http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00099.html


I committed this patch that I think should fix this problem.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and 4.8 branch.

Ian


2013-08-06  Ian Lance Taylor  <iant@google.com>

	* go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use
	compute_reloc_for_constant.

[-- Attachment #2: foo.patch --]
[-- Type: application/octet-stream, Size: 520 bytes --]

Index: go-gcc.cc
===================================================================
--- go-gcc.cc	(revision 201446)
+++ go-gcc.cc	(working copy)
@@ -1525,7 +1525,9 @@ Gcc_backend::immutable_struct_set_init(B
 
   // These variables are often unneeded in the final program, so put
   // them in their own section so that linker GC can discard them.
-  resolve_unique_section(decl, 1, 1);
+  resolve_unique_section(decl,
+			 compute_reloc_for_constant (init_tree),
+			 1);
 
   rest_of_decl_compilation(decl, 1, 0);
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Go patch committed: Always put immutable structs in unique section
  2013-08-06 16:42 ` Ian Lance Taylor
@ 2013-08-07 10:39   ` Uros Bizjak
  0 siblings, 0 replies; 4+ messages in thread
From: Uros Bizjak @ 2013-08-07 10:39 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

On Tue, Aug 6, 2013 at 6:42 PM, Ian Lance Taylor <iant@google.com> wrote:

> I committed this patch that I think should fix this problem.
> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
> Committed to mainline and 4.8 branch.
>
> 2013-08-06  Ian Lance Taylor  <iant@google.com>
>
>         * go-gcc.cc (Gcc_backend::immutable_struct_set_init): Use
>         compute_reloc_for_constant.

Yes, the gcc-go testsuite is now clean, but there remain a few
warnings in the libgo testsuite. I have attached the testsuite run log
to this message (there are also some new errors, but these are due to
unrelated recent compiler changes. I'll investigate these later).

Thanks,
Uros.

[-- Attachment #2: libgo.log --]
[-- Type: application/octet-stream, Size: 13407 bytes --]

Test Run By uros on Wed Aug  7 12:05:13 CEST 2013
Native configuration is alphaev68-unknown-linux-gnu

		=== libgo tests ===

PASS
PASS: bufio
PASS
PASS: bytes
/tmp/ccwde2We.s: Assembler messages:
/tmp/ccwde2We.s:325: Warning: setting incorrect section attributes for .rodata.__go_tdn_errors..errors.errorString
PASS
PASS: errors
PASS
PASS: expvar
flag provided but not defined: -x
flag needs an argument: -b
Usage of test:
  -b=0: usage
PASS
PASS: flag
Aborted

../../../gcc-svn/trunk/libgo/testsuite/gotest: line 486: 14075 Segmentation fault      ./a.out -test.short -test.timeout=${timeout}s "$@"
FAIL: fmt
../../../gcc-svn/trunk/libgo/testsuite/gotest: line 482: gotest-timeout: No such file or directory
PASS
PASS: html
PASS
PASS: image
/tmp/ccERbjS9.s: Assembler messages:
/tmp/ccERbjS9.s:9010: Warning: setting incorrect section attributes for .rodata.__go_tdn_io..io.teeReader
PASS
PASS: io
PASS
PASS: log
PASS
PASS: math
PASS
PASS: mime
/tmp/cc7dwKqG.s: Assembler messages:
/tmp/cc7dwKqG.s:20063: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.netFD
/tmp/cc7dwKqG.s:34216: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.dnsRR_Header
/tmp/cc7dwKqG.s:34534: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.dnsRR_SRV
/tmp/cc7dwKqG.s:35247: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.dnsMsgHdr
/tmp/cc7dwKqG.s:140562: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.dnsRR_CNAME
/tmp/cc7dwKqG.s:145405: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.dnsRR_A
/tmp/cc7dwKqG.s:145698: Warning: setting incorrect section attributes for .rodata.__go_tdn_net..net.dnsRR_AAAA
PASS
PASS: net
/tmp/ccxzOReu.s: Assembler messages:
/tmp/ccxzOReu.s:15365: Warning: setting incorrect section attributes for .rodata.__go_tdn_os..os.file
/tmp/ccxzOReu.s:23146: Warning: setting incorrect section attributes for .rodata.__go_tdn_os..os.fileStat
PASS
PASS: os
PASS
PASS: path
PASS
PASS: reflect
PASS
PASS: regexp
PASS
PASS: runtime
PASS
PASS: sort
PASS
PASS: strconv
/tmp/ccLGrjf0.s: Assembler messages:
/tmp/ccLGrjf0.s:8549: Warning: setting incorrect section attributes for .rodata.__go_tdn_strings..strings.singleStringReplacer
PASS
PASS: strings
PASS
PASS: sync
PASS
PASS: syscall
PASS
PASS: time
PASS
PASS: unicode
PASS
PASS: archive/tar
/tmp/ccyK8WVc.s: Assembler messages:
/tmp/ccyK8WVc.s:17468: Warning: setting incorrect section attributes for .rodata.__go_tdn_archive_zip..archive_zip.checksumReader
/tmp/ccyK8WVc.s:22537: Warning: setting incorrect section attributes for .rodata.__go_tdn_archive_zip..archive_zip.countWriter
/tmp/ccyK8WVc.s:24524: Warning: setting incorrect section attributes for .rodata.__go_tdn_archive_zip..archive_zip.fileWriter
PASS
PASS: archive/zip
PASS
PASS: compress/bzip2
/tmp/cc0KF3Yc.s: Assembler messages:
/tmp/cc0KF3Yc.s:24873: Warning: setting incorrect section attributes for .rodata.__go_tdn_compress_flate..compress_flate.dictWriter
PASS
PASS: compress/flate
PASS
PASS: compress/gzip
PASS
PASS: compress/lzw
PASS
PASS: compress/zlib
PASS
PASS: container/heap
PASS
PASS: container/list
PASS
PASS: container/ring
PASS
PASS: crypto/aes
PASS
PASS: crypto/cipher
PASS
PASS: crypto/des
PASS
PASS: crypto/dsa
PASS
PASS: crypto/ecdsa
PASS
PASS: crypto/elliptic
PASS
PASS: crypto/hmac
PASS
PASS: crypto/md5
/tmp/cc4vtARi.s: Assembler messages:
/tmp/cc4vtARi.s:5509: Warning: setting incorrect section attributes for .rodata.__go_tdn_crypto_rand..crypto_rand.devReader
/tmp/cc4vtARi.s:6262: Warning: setting incorrect section attributes for .rodata.__go_tdn_crypto_rand..crypto_rand.reader
PASS
PASS: crypto/rand
PASS
PASS: crypto/rc4
PASS
PASS: crypto/rsa
PASS
PASS: crypto/sha1
PASS
PASS: crypto/sha256
PASS
PASS: crypto/sha512
PASS
PASS: crypto/subtle
PASS
PASS: crypto/tls
PASS
PASS: crypto/x509
/tmp/cch4KX1D.s: Assembler messages:
/tmp/cch4KX1D.s:8782: Warning: setting incorrect section attributes for .rodata.__go_tdn_database_sql..database_sql.driverStmt
/tmp/cch4KX1D.s:20930: Warning: setting incorrect section attributes for .rodata.__go_tdn_database_sql..database_sql.fakeConn
PASS
PASS: database/sql
PASS
PASS: database/sql/driver
PASS
PASS: debug/dwarf
PASS
PASS: debug/elf
PASS
PASS: debug/macho
PASS
PASS: debug/pe
/tmp/ccNRYpeN.s: Assembler messages:
/tmp/ccNRYpeN.s:7921: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_ascii85..encoding_ascii85.encoder
PASS
PASS: encoding/ascii85
PASS
PASS: encoding/asn1
PASS
PASS: encoding/base32
PASS
PASS: encoding/base64
PASS
PASS: encoding/binary
PASS
PASS: encoding/csv
/tmp/ccpW2AvK.s: Assembler messages:
/tmp/ccpW2AvK.s:14522: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_gob..encoding_gob.fieldType
/tmp/ccpW2AvK.s:25835: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_gob.TestOverflow.7..encoding_gob.outf32
/tmp/ccpW2AvK.s:25955: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_gob.TestOverflow.8..encoding_gob.outc64
/tmp/ccpW2AvK.s:79395: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_gob..encoding_gob.userTypeInfo
mallocs per encode of type Bench: 21.024
mallocs per decode of type Bench: 23
PASS
PASS: encoding/gob
/tmp/cceFBOvT.s: Assembler messages:
/tmp/cceFBOvT.s:8119: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_hex..encoding_hex.dumper
PASS
PASS: encoding/hex
PASS
PASS: encoding/json
PASS
PASS: encoding/pem
/tmp/ccrMn63Y.s: Assembler messages:
/tmp/ccrMn63Y.s:69589: Warning: setting incorrect section attributes for .rodata.__go_tdn_encoding_xml..encoding_xml.stack
PASS
PASS: encoding/xml
/tmp/ccwQ4GL4.s: Assembler messages:
/tmp/ccwQ4GL4.s:8938: Warning: setting incorrect section attributes for .rodata.__go_tdn_exp_proxy..exp_proxy.socks5
PASS
PASS: exp/proxy
PASS
PASS: exp/terminal
--- FAIL: TestErrors (0.00 seconds)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x18]

goroutine 165 [running]:
panic during panic
FAIL: html/template
../../../gcc-svn/trunk/libgo/testsuite/gotest: line 482: gotest-timeout: No such file or directory
PASS
PASS: go/ast
PASS
PASS: go/doc
PASS
PASS: go/format
PASS
PASS: go/parser
PASS
PASS: go/printer
PASS
PASS: go/scanner
PASS
PASS: go/token
PASS
PASS: hash/adler32
PASS
PASS: hash/crc32
PASS
PASS: hash/crc64
PASS
PASS: hash/fnv
PASS
PASS: image/color
PASS
PASS: image/draw
PASS
PASS: image/jpeg
PASS
PASS: image/png
PASS
PASS: index/suffixarray
PASS
PASS: io/ioutil
PASS
PASS: log/syslog
PASS
PASS: math/big
PASS
PASS: math/cmplx
/tmp/ccDEyztX.s: Assembler messages:
/tmp/ccDEyztX.s:11613: Warning: setting incorrect section attributes for .rodata.__go_tdn_math_rand..math_rand.lockedSource
PASS
PASS: math/rand
/tmp/ccUREmFb.s: Assembler messages:
/tmp/ccUREmFb.s:7485: Warning: setting incorrect section attributes for .rodata.__go_tdn_mime_multipart..mime_multipart.slowReader
/tmp/ccUREmFb.s:30427: Warning: setting incorrect section attributes for .rodata.__go_tdn_mime_multipart..mime_multipart.part
PASS
PASS: mime/multipart
/tmp/ccumqOwE.s: Assembler messages:
/tmp/ccumqOwE.s:30510: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.connectMethod
/tmp/ccumqOwE.s:46052: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.readerAndCloser
/tmp/ccumqOwE.s:51103: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.chunkedReader
/tmp/ccumqOwE.s:52118: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.chunkedWriter
/tmp/ccumqOwE.s:61201: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.populateResponse
/tmp/ccumqOwE.s:76913: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.maxBytesReader
/tmp/ccumqOwE.s:79728: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.switchReader
/tmp/ccumqOwE.s:79975: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.switchWriter
/tmp/ccumqOwE.s:80191: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.conn
/tmp/ccumqOwE.s:105755: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.timeoutWriter
/tmp/ccumqOwE.s:113838: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http..net_http.body
Aborted

../../../gcc-svn/trunk/libgo/testsuite/gotest: line 486: 15886 Segmentation fault      ./a.out -test.short -test.timeout=${timeout}s "$@"
FAIL: net/http
PASS
PASS: net/http/cgi
PASS
PASS: net/http/cookiejar
/tmp/ccHw8TW4.s: Assembler messages:
/tmp/ccHw8TW4.s:14363: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_fcgi..net_http_fcgi.bufWriter
/tmp/ccHw8TW4.s:21483: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_fcgi..net_http_fcgi.streamWriter
PASS
PASS: net/http/fcgi
/tmp/ccSfc9U6.s: Assembler messages:
/tmp/ccSfc9U6.s:17730: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_httptest..net_http_httptest.waitGroupHandler
PASS
PASS: net/http/httptest
/tmp/cclEHwrB.s: Assembler messages:
/tmp/cclEHwrB.s:18369: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_httputil..net_http_httputil.chunkedReader
/tmp/cclEHwrB.s:19455: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_httputil..net_http_httputil.chunkedWriter
/tmp/cclEHwrB.s:21611: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_httputil..net_http_httputil.delegateReader
/tmp/cclEHwrB.s:31847: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_http_httputil..net_http_httputil.maxLatencyWriter
PASS
PASS: net/http/httputil
PASS
PASS: net/mail
/tmp/ccoBgZbJ.s: Assembler messages:
/tmp/ccoBgZbJ.s:19813: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_rpc..net_rpc.methodType
/tmp/ccoBgZbJ.s:33190: Warning: setting incorrect section attributes for .rodata.__go_tdn_net_rpc..net_rpc.gobClientCodec
2013/08/07 12:17:17 Test RPC server listening on 127.0.0.1:46371
2013/08/07 12:17:17 Test HTTP RPC server listening on 127.0.0.1:55888
2013/08/07 12:17:17 rpc: rpc: can't find method Arith.BadOperation
2013/08/07 12:17:17 rpc: rpc: can't find method Arith.Unknown
2013/08/07 12:17:17 rpc: gob: type mismatch: no fields matched compiling decoder for Args
2013/08/07 12:17:17 NewServer test RPC server listening on 127.0.0.1:56838
2013/08/07 12:17:17 rpc: rpc: can't find method Arith.BadOperation
2013/08/07 12:17:17 rpc: rpc: can't find method Arith.Unknown
2013/08/07 12:17:17 rpc: gob: type mismatch: no fields matched compiling decoder for Args
2013/08/07 12:17:17 method ReplyNotPointer reply type not a pointer: rpc.Reply
2013/08/07 12:17:17 rpc.Register: type ReplyNotPointer has no exported methods of suitable type
2013/08/07 12:17:17 ArgNotPublic argument type not exported: *rpc.local
2013/08/07 12:17:17 rpc.Register: type ArgNotPublic has no exported methods of suitable type
2013/08/07 12:17:17 method ReplyNotPublic reply type not exported: *rpc.local
2013/08/07 12:17:17 rpc.Register: type ReplyNotPublic has no exported methods of suitable type
2013/08/07 12:17:17 rpc.Register: type NeedsPtrType has no exported methods of suitable type (hint: pass a pointer to value of that type)
mallocs per rpc round trip: 267.01
mallocs per HTTP rpc round trip: 267.01
2013/08/07 12:17:18 rpc: client protocol error: unexpected EOF
PASS
PASS: net/rpc
PASS
PASS: net/smtp
PASS
PASS: net/textproto
PASS
PASS: net/url
2013/08/07 12:17:37 rpc: jsonrpc: request body missing params
2013/08/07 12:17:37 rpc: rpc: service/method request ill-formed: 
2013/08/07 12:17:37 rpc: rpc: server cannot decode request: invalid character 'i' looking for beginning of object key string
2013/08/07 12:17:37 rpc: client protocol error: invalid error <nil>
2013/08/07 12:17:37 rpc: rpc: server cannot decode request: unexpected error!
PASS
PASS: net/rpc/jsonrpc
/tmp/ccpj92lO.s: Assembler messages:
/tmp/ccpj92lO.s:5473: Warning: setting incorrect section attributes for .rodata.__go_tdn_old_regexp..old_regexp.instr
PASS
PASS: old/regexp
/tmp/ccONW0Z4.s: Assembler messages:
/tmp/ccONW0Z4.s:17623: Warning: setting incorrect section attributes for .rodata.__go_tdn_old_template..old_template.sectionElement
/tmp/ccONW0Z4.s:17769: Warning: setting incorrect section attributes for .rodata.__go_tdn_old_template..old_template.repeatedElement
PASS
PASS: old/template
PASS
PASS: os/exec
PASS
PASS: os/signal
PASS
PASS: os/user
PASS
PASS: path/filepath
PASS
PASS: regexp/syntax
[0 3 0 10000 0 96 4 4831960195 4832698995 2199023565807 0 0 1 0] 14
[0 3 0 10000 0] [96 4 4831960195 4832698995 2199023565807 0] [0 1 0]
--- FAIL: TestCPUProfile (1.07 seconds)
	pprof_test.go:91: did not find ChecksumIEEE in the profile
FAIL
FAIL: runtime/pprof
PASS
PASS: sync/atomic
PASS
PASS: text/scanner
PASS
PASS: text/tabwriter
PASS
PASS: text/template
PASS
PASS: text/template/parse
PASS
PASS: testing/quick
PASS
PASS: unicode/utf16
PASS
PASS: unicode/utf8

runtest completed at Wed Aug  7 12:20:06 CEST 2013

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Go patch committed: Always put immutable structs in unique section
@ 2013-08-02 18:27 Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2013-08-02 18:27 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

The Go backend interfaces uses immutable structs for things like type
descriptors, map descriptors, and function descriptors.  These objects
must always be created for exported names in case they are referenced by
a different package, but this often does not happen.  This patch moves
them to unique sections so that linker GC can discard them a link time.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and 4.8 branch.

Ian


2013-08-02  Ian Lance Taylor  <iant@google.com>

	* go-gcc.cc (immutable_struct_set_init): Always call
	resolve_unique_section.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 651 bytes --]

Index: go-gcc.cc
===================================================================
--- go-gcc.cc	(revision 201222)
+++ go-gcc.cc	(working copy)
@@ -1521,10 +1521,11 @@ Gcc_backend::immutable_struct_set_init(B
 	TREE_PUBLIC(decl) = 1;
     }
   else
-    {
-      make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
-      resolve_unique_section(decl, 1, 0);
-    }
+    make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
+
+  // These variables are often unneeded in the final program, so put
+  // them in their own section so that linker GC can discard them.
+  resolve_unique_section(decl, 1, 1);
 
   rest_of_decl_compilation(decl, 1, 0);
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-07 10:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06  9:20 Go patch committed: Always put immutable structs in unique section Uros Bizjak
2013-08-06 16:42 ` Ian Lance Taylor
2013-08-07 10:39   ` Uros Bizjak
  -- strict thread matches above, loose matches on Subject: below --
2013-08-02 18:27 Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).