[Patch] sh64: Fix problem with datalabel and --gc-sections

Clarke, Stephen stephen.clarke@superh.com
Wed Aug 14 13:56:00 GMT 2002


The attached patch fixes a bug in sh64 ld, and adds a regression
testcase to the ld testsuite.

The bug is caused by --gc-sections discarding a section referred
to by a datalabel-qualified reference.

The following shows the symptoms:

$ cat dlsection-1.s
	.mode SHmedia
	.text
	.global start
	.global foo
start:	.long datalabel foo

	.section .text2,"ax"
foo:	.long 23
$ sh64-elf-as --abi=32 -o dlsection-1.o dlsection-1.s
$ sh64-elf-ld -mshelf32 --gc-sections dlsection-1.o
dlsection-1.o: In function `start':
dlsection-1.o(.text+0x0): undefined reference to `foo'
$ 


(The regression test involves adding a couple of files to the ld
testsuite. I wasn't sure of the correct way to represent new
files in the patch, please let me know if there's a better way
to handle them.)

Steve.
--
Stephen Clarke, Principal Engineer, SuperH Inc.
Phone:1-408-273-3146, Fax:1-408-273-3199, mailto:Stephen.Clarke@superh.com
Mail:  SuperH Inc., 405 River Oaks Pkwy, San Jose, CA 95134, USA.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc-sections.patch
Type: application/octet-stream
Size: 3827 bytes
Desc: gc-sections.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20020814/6b2a6082/attachment.obj>


More information about the Binutils mailing list