Fix diagnostic on "gnu.warning" section

Vladimir Prus vladimir@codesourcery.com
Sat Nov 4 10:16:00 GMT 2006


At the moment, if ld sees a symbol in "gnu.warning", it will emit a warning of 
the form:

	<some.file>: warning: warning: <warning text>

with the word "warning" repeated twice. This patch fixes this and adds a test 
for the right message. OK?

- Volodya

2006-11-04  Vladimir Prus  <vladimir@codesourcery.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
	Don't prepend "warning" to the message.

2006-11-04  Vladimir Prus  <vladimir@codesourcery.com>	
	
	* testsuite/ld-elf/warn2.d: New.
	* testsuite/ld-elf/symbol2w.s: New.
	* testsuite/ld-elf/symbol2ref.s: New.	


-------------- next part --------------
A non-text attachment was scrubbed...
Name: warning.diff
Type: text/x-diff
Size: 1167 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20061104/480aab77/attachment.bin>
-------------- next part --------------
	.text
	.long Foo

-------------- next part --------------
        .section        .gnu.warning,"a",@progbits
	.global Foo
        .type   Foo, @object
        .size   Foo, 20
Foo:
        .string "function 'Foo' used"
-------------- next part --------------
#source: start.s
#source: symbol2ref.s
#source: symbol2w.s
#ld: -T group.ld
#warning: ^[^\\n]*\.[obj]+: warning: function 'Foo' used$
#readelf: -s
#notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "or32-*-*" "pj-*-*"

# Check that warnings are generated for the symbols in .gnu.warning
# construct and that the symbol still appears as expected.

#...
[ 	]+[0-9]+:[ 	]+[0-9a-f]+[ 	]+20[ 	]+OBJECT[	 ]+GLOBAL DEFAULT[ 	]+ABS Foo
#pass


More information about the Binutils mailing list