public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA:] Trivial test for .gnu.warning.SYMBOL
@ 2005-02-06 14:33 Hans-Peter Nilsson
  2005-02-06 15:07 ` Ian Lance Taylor
  2005-02-13 17:18 ` Eric Botcazou
  0 siblings, 2 replies; 8+ messages in thread
From: Hans-Peter Nilsson @ 2005-02-06 14:33 UTC (permalink / raw)
  To: binutils

I noticed the lack of even trivial test-cases for ".gnu.warning".
Here's one for .gnu.warning.SYMBOL.
Ok to commit?

ld/testsuite:
	* ld-elf/start.s, ld-elf/symbolref.s, ld-elf/symbol1w.s,
	ld-elf/warn1.d: New test.

--- /dev/null	Tue Oct 29 15:57:07 2002
+++ start.s	Sat Feb  5 03:12:33 2005
@@ -0,0 +1,4 @@
+	.text
+	.global _start
+_start:
+	.long 0
--- /dev/null	Tue Oct 29 15:57:07 2002
+++ symbol1ref.s	Sat Feb  5 03:12:49 2005
@@ -0,0 +1,3 @@
+	.text
+	.long symbol1
+
--- /dev/null	Tue Oct 29 15:57:07 2002
+++ symbol1w.s	Sat Feb  5 03:32:12 2005
@@ -0,0 +1,6 @@
+	.section .gnu.warning.symbol1
+	.asciz "witty one-liner"
+	.text
+	.global symbol1
+symbol1:
+	.long 0
--- /dev/null	Tue Oct 29 15:57:07 2002
+++ warn1.d	Sat Feb  5 05:06:00 2005
@@ -0,0 +1,13 @@
+#source: start.s
+#source: symbol1ref.s
+#source: symbol1w.s
+#ld: 
+#warning: ^[^\\n]*\): warning: witty one-liner$
+#readelf: -s
+
+# Check that warnings are generated for the .gnu.warning.SYMBOL
+# construct and that the symbol still appears as expected.
+
+#...
+[ 	]+[0-9]+:[ 	]+[0-9]+[ 	]+0[ 	]+NOTYPE[ 	]+GLOBAL DEFAULT[ 	]+[1-9] symbol1
+#pass

brgds, H-P

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-06 14:33 [RFA:] Trivial test for .gnu.warning.SYMBOL Hans-Peter Nilsson
@ 2005-02-06 15:07 ` Ian Lance Taylor
  2005-02-13 17:18 ` Eric Botcazou
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Lance Taylor @ 2005-02-06 15:07 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils

Hans-Peter Nilsson <hans-peter.nilsson@axis.com> writes:

> I noticed the lack of even trivial test-cases for ".gnu.warning".
> Here's one for .gnu.warning.SYMBOL.
> Ok to commit?
> 
> ld/testsuite:
> 	* ld-elf/start.s, ld-elf/symbolref.s, ld-elf/symbol1w.s,
> 	ld-elf/warn1.d: New test.

This is OK.  Thanks.

Ian

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-06 14:33 [RFA:] Trivial test for .gnu.warning.SYMBOL Hans-Peter Nilsson
  2005-02-06 15:07 ` Ian Lance Taylor
@ 2005-02-13 17:18 ` Eric Botcazou
  2005-02-13 19:22   ` Hans-Peter Nilsson
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Botcazou @ 2005-02-13 17:18 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils

> --- /dev/null	Tue Oct 29 15:57:07 2002
> +++ symbol1ref.s	Sat Feb  5 03:12:49 2005
> @@ -0,0 +1,3 @@
> +	.text
> +	.long symbol1
> +

That doesn't work on SPARC 64-bit, the relocation is truncated because 'long' 
is 4-byte wide.  The correct opcode would be '.xword' here.

I'm not really familiar with the testsuite harness: how can the problem be 
(elegantly) solved?

Thanks in advance.

-- 
Eric Botcazou

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-13 17:18 ` Eric Botcazou
@ 2005-02-13 19:22   ` Hans-Peter Nilsson
  2005-02-13 20:39     ` Eric Botcazou
  0 siblings, 1 reply; 8+ messages in thread
From: Hans-Peter Nilsson @ 2005-02-13 19:22 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Hans-Peter Nilsson, binutils

On Sun, 13 Feb 2005, Eric Botcazou wrote:
> > --- /dev/null	Tue Oct 29 15:57:07 2002
> > +++ symbol1ref.s	Sat Feb  5 03:12:49 2005
> > @@ -0,0 +1,3 @@
> > +	.text
> > +	.long symbol1
> > +
>
> That doesn't work on SPARC 64-bit,

Yes it does, at least for sparc64-linux-gnu cross from
i686-pc-linux-gnu.

> the relocation is truncated because 'long'
> is 4-byte wide.  The correct opcode would be '.xword' here.

The truncation doesn't matter for the purpose of this test, as
long as ld doesn't emit an error or warning message.

> I'm not really familiar with the testsuite harness: how can the problem be
> (elegantly) solved?

No need this time, but for future reference, look in
ld/testsuite/ld-lib.exp:run_dump_test, where the big header
comment provides all :-/ documentation.  There's a specific
directive to exclude targets.

brgds, H-P

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-13 19:22   ` Hans-Peter Nilsson
@ 2005-02-13 20:39     ` Eric Botcazou
  2005-02-14  0:17       ` Hans-Peter Nilsson
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Botcazou @ 2005-02-13 20:39 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils, Hans-Peter Nilsson

> Yes it does, at least for sparc64-linux-gnu cross from
> i686-pc-linux-gnu.

And?  What do you think will happen on a 64-bit SPARC platform where the text 
segment is not located in the lower 32-bit part of the address space?

> The truncation doesn't matter for the purpose of this test, as
> long as ld doesn't emit an error or warning message.

./ld-new  -L/home/eric/cvs/binutils/ld/testsuite/ld-elf   -o tmpdir/dump 
tmpdir/dump0.o tmpdir/dump1.o tmpdir/dump2.o
failed with: <tmpdir/dump1.o:(.text+0x0): warning: witty one-liner
tmpdir/dump1.o:(.text+0x0): relocation truncated to fit: R_SPARC_32 against 
symbol `symbol1' defined in .text section in tmpdir/dump2.o>, expected: 
<^[^\\n]*\): warning: witty one-liner$>
tmpdir/dump1.o:(.text+0x0): warning: witty one-liner
tmpdir/dump1.o:(.text+0x0): relocation truncated to fit: R_SPARC_32 against 
symbol `symbol1' defined in .text section in tmpdir/dump2.o
FAIL: ld-elf/warn1

This is on Solaris 64-bit.

> No need this time, but for future reference, look in
> ld/testsuite/ld-lib.exp:run_dump_test, where the big header
> comment provides all :-/ documentation.  There's a specific
> directive to exclude targets.

Thanks.

-- 
Eric Botcazou

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-13 20:39     ` Eric Botcazou
@ 2005-02-14  0:17       ` Hans-Peter Nilsson
  2005-02-14  9:18         ` Eric Botcazou
  0 siblings, 1 reply; 8+ messages in thread
From: Hans-Peter Nilsson @ 2005-02-14  0:17 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: binutils, Hans-Peter Nilsson

On Sun, 13 Feb 2005, Eric Botcazou wrote:
> > Yes it does, at least for sparc64-linux-gnu cross from
> > i686-pc-linux-gnu.
>
> And?  What do you think will happen on a 64-bit SPARC platform where the text
> segment is not located in the lower 32-bit part of the address space?

Since you failed to include a target specification where the
test failed, I had to assume that all such targets had the same
behavior (e.g. program address map) and pick one and test.
No need to ask rhetorical redundant questions.

> > No need this time, but for future reference, look in
> > ld/testsuite/ld-lib.exp:run_dump_test, where the big header
> > comment provides all :-/ documentation.  There's a specific
> > directive to exclude targets.

In turn, I'll be more specific: "#notarget: sparc64-*-solaris*"
But that's just a guess.

brgds, H-P

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-14  0:17       ` Hans-Peter Nilsson
@ 2005-02-14  9:18         ` Eric Botcazou
  2005-02-14 10:38           ` Hans-Peter Nilsson
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Botcazou @ 2005-02-14  9:18 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils, Hans-Peter Nilsson

> Since you failed to include a target specification where the
> test failed, I had to assume that all such targets had the same
> behavior (e.g. program address map) and pick one and test.

You simply could have trusted me.

> In turn, I'll be more specific: "#notarget: sparc64-*-solaris*"
> But that's just a guess.

Thanks, works fine.  I initially went for "xfail", but I agree that "notarget" 
is better.


I commited this as obvious:

Index: warn1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/warn1.d,v
retrieving revision 1.1
diff -u -r1.1 warn1.d
--- warn1.d     7 Feb 2005 02:46:15 -0000       1.1
+++ warn1.d     13 Feb 2005 18:39:43 -0000
@@ -4,6 +4,7 @@
 #ld:
 #warning: ^[^\\n]*\): warning: witty one-liner$
 #readelf: -s
+#notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"

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

-- 
Eric Botcazou

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

* Re: [RFA:] Trivial test for .gnu.warning.SYMBOL
  2005-02-14  9:18         ` Eric Botcazou
@ 2005-02-14 10:38           ` Hans-Peter Nilsson
  0 siblings, 0 replies; 8+ messages in thread
From: Hans-Peter Nilsson @ 2005-02-14 10:38 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: binutils, Hans-Peter Nilsson

On Sun, 13 Feb 2005, Eric Botcazou wrote:
> > Since you failed to include a target specification where the
> > test failed, I had to assume that all such targets had the same
> > behavior (e.g. program address map) and pick one and test.
>
> You simply could have trusted me.

Your original message (not the least not quoting log contents or
target triple) sounded like you just noticed this on code
inspection, as opposed to actual test results.  So there was
nothing to trust but an assertion that matched up as an invalid
assumption (that truncation mattered or always caused error).

> +#notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"

Quotes not needed.

brgds, H-P

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

end of thread, other threads:[~2005-02-13 20:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-06 14:33 [RFA:] Trivial test for .gnu.warning.SYMBOL Hans-Peter Nilsson
2005-02-06 15:07 ` Ian Lance Taylor
2005-02-13 17:18 ` Eric Botcazou
2005-02-13 19:22   ` Hans-Peter Nilsson
2005-02-13 20:39     ` Eric Botcazou
2005-02-14  0:17       ` Hans-Peter Nilsson
2005-02-14  9:18         ` Eric Botcazou
2005-02-14 10:38           ` Hans-Peter Nilsson

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).