Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* NetBSD testsuite patch (revised)
@ 2003-11-23  9:32 Ben Elliston
  2003-11-24  4:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Elliston @ 2003-11-23  9:32 UTC (permalink / raw)
  To: gdb-patches

Here is a more complete patch that gets the asm-source.exp tests
passing on NetBSD/i386.  The rationale behind this change is to force
the linker to pass `--entry _start' for all target systems, since the
asmsrc.1 file hardwires the symbol name to `_start'.  This simplifies
things and makes it possible to remove the duplicated label __start in
mips.inc.

This patch supersedes my previous patch.  Okay to commit?

Ben


2003-11-23  Ben Elliston  <bje@wasabisystems.com>

	* gdb.asm/asm-source.exp: Make sure the final link succeeds on
	NetBSD as it does on FreeBSD.  Modelled on a similar change by
	Mark Kettenis on 2003-05-30.
	(link-flags): Set to "--entry _start" regardless of target.
	Special linker flags are to be appended to $link-flags.
	* gdb.asm/mips.inc (gdbasm_startup): Remove __start label.

Index: asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.43
diff -u -p -r1.43 asm-source.exp
--- asm-source.exp	15 Sep 2003 09:52:56 -0000	1.43
+++ asm-source.exp	23 Nov 2003 09:29:38 -0000
@@ -33,7 +33,7 @@ set bug_id 0
 
 set asm-arch ""
 set asm-flags ""
-set link-flags ""
+set link-flags "--entry _start"
 
 switch -glob -- [istarget] {
     "alpha*-*-*" {
@@ -63,13 +63,10 @@ switch -glob -- [istarget] {
     }
     "i\[3456\]86-*-*" {
         set asm-arch i386
-        if [istarget "*-*-cygwin*"] then {
-            set link-flags "--entry _start"
-        }
     }
     "m32r*-*" {
         set asm-arch m32r
-        set link-flags "-Wl,--whole-archive -lgloss -Wl,--no-whole-archive"
+        append link-flags " -Wl,--whole-archive -lgloss -Wl,--no-whole-archive"
     }
     "m6811-*-*" {
         set asm-arch m68hc11
@@ -88,7 +85,6 @@ switch -glob -- [istarget] {
     "sh*-*-*" {
         set asm-arch sh
         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
-        set link-flags "--entry _start"
     }
     "sparc-*-*" {
         set asm-arch sparc
@@ -118,13 +114,14 @@ if { "${asm-arch}" == "" } {
     gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
 }
 
-# On FreeBSD, crt1.o the final link will fail because of unresolved
-# symbols.  It turns out that libc.so references symbols that are
-# normally provided by crt1.o, which isn't linked in since we specify
-# -nostartfiles.  Using -nostdlib doesn't help since target_compile
-# automatically adds -lm.  Linking statically avoids this mess.
-if [istarget "*-*-freebsd*"] then {
-    set link-flags "-static"
+# On FreeBSD and NetBSD, crt1.o the final link will fail because of
+# unresolved symbols.  It turns out that libc.so references symbols
+# that are normally provided by crt1.o, which isn't linked in since we
+# specify -nostartfiles.  Using -nostdlib doesn't help since
+# target_compile automatically adds -lm.  Linking statically avoids
+# this mess.
+if {[istarget "*-*-freebsd*"] || [istarget "*-*-netbsd*"]} then {
+    append link-flags " -static"
 }
 
 # Watch out, we are invoking the assembler, but the testsuite sets multilib
Index: mips.inc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/mips.inc,v
retrieving revision 1.1
diff -u -p -r1.1 mips.inc
--- mips.inc	22 Oct 2002 01:43:37 -0000	1.1
+++ mips.inc	23 Nov 2003 09:29:38 -0000
@@ -58,7 +58,5 @@
 
 	comment "crt0 startup"
 	.macro gdbasm_startup
-	.global __start
-__start:
 	move	$fp, $sp
 	.endm


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

* Re: NetBSD testsuite patch (revised)
  2003-11-23  9:32 NetBSD testsuite patch (revised) Ben Elliston
@ 2003-11-24  4:24 ` Daniel Jacobowitz
  2003-11-26  1:21   ` Ben Elliston
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-11-24  4:24 UTC (permalink / raw)
  To: Ben Elliston; +Cc: gdb-patches

On Sun, Nov 23, 2003 at 08:32:52PM +1100, Ben Elliston wrote:
> Here is a more complete patch that gets the asm-source.exp tests
> passing on NetBSD/i386.  The rationale behind this change is to force
> the linker to pass `--entry _start' for all target systems, since the
> asmsrc.1 file hardwires the symbol name to `_start'.  This simplifies
> things and makes it possible to remove the duplicated label __start in
> mips.inc.
> 
> This patch supersedes my previous patch.  Okay to commit?

I don't suppose you could test this on a mips-elf simulator target?  I
believe asm-source works OK there.  If it still does, this is OK.

> 2003-11-23  Ben Elliston  <bje@wasabisystems.com>
> 
> 	* gdb.asm/asm-source.exp: Make sure the final link succeeds on
> 	NetBSD as it does on FreeBSD.  Modelled on a similar change by
> 	Mark Kettenis on 2003-05-30.
> 	(link-flags): Set to "--entry _start" regardless of target.
> 	Special linker flags are to be appended to $link-flags.
> 	* gdb.asm/mips.inc (gdbasm_startup): Remove __start label.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: NetBSD testsuite patch (revised)
  2003-11-24  4:24 ` Daniel Jacobowitz
@ 2003-11-26  1:21   ` Ben Elliston
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Elliston @ 2003-11-26  1:21 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Daniel Jacobowitz <drow@mvista.com> writes:

> > This patch supersedes my previous patch.  Okay to commit?
> 
> I don't suppose you could test this on a mips-elf simulator target?
> I believe asm-source works OK there.  If it still does, this is OK.

Without my patch, the test case fails on mips-sim with undefined
references to _init and _fini.  With my patch, the test case behaves
identically, so I committed it on the basis that my patch does not
cause a regression.

Ben


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

end of thread, other threads:[~2003-11-26  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-23  9:32 NetBSD testsuite patch (revised) Ben Elliston
2003-11-24  4:24 ` Daniel Jacobowitz
2003-11-26  1:21   ` Ben Elliston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox