This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

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


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.

Attachment: gc-sections.patch
Description: gc-sections.patch


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