ld-elf/exclude1.s, exclude.exp

Hans-Peter Nilsson hp@bitrange.com
Mon Oct 18 18:59:00 GMT 2004


On Sat, 16 Oct 2004, Hans-Peter Nilsson wrote:

> On Sat, 16 Oct 2004, Daniel Jacobowitz wrote:
> > On Sat, Oct 16, 2004 at 03:36:00PM -0400, Hans-Peter Nilsson wrote:
> > > ERROR: /h/hp/binutils/cvs_latest/src/ld/testsuite/ld-elf/exclude1.s: assembly failed
> > > Why not just " .long exclude_symbol"?
> >
> > I figure if I pick a non-PC-relative reloc someone won't have one in
> > the right size.  But if you think .long is more likely to work, then
> > that's fine.
>
> Use of .long with a symbolic operand is already in multiple
> places in ld-testsuite so I think that's sufficient.

Wait... I take that back: the code is going into a DSO, so an
absolute reloc is going to get problems with targets where ld
complains about the result being textrel: "you probably meant to
compile with -fPIC" and similar.

However, I don't want "make check" to exit with error as it
complicates my autotester.  One error-exit setter is
"unresolved".  Is it ok to just mark the test as "unsupported"
if assembly fails?  Another setter is "perror".  Quite
redundantly, as callers use the function return code.  Is it ok
to use "warning" instead?  If any answer is "no", I'll just add
cris-*-elf to the early exit in exclude.exp.

ld/testsuite:

	* lib/ld-lib.exp (default_ld_assemble): Use warning, not perror,
	for failing assembly.
	* ld-elf/exclude.exp: If assembly fails, mark test as unsupported
	rather than unresolved.

Index: ld-lib.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
retrieving revision 1.27
diff -c -p -r1.27 ld-lib.exp
*** ld-lib.exp	12 May 2004 03:08:09 -0000	1.27
--- ld-lib.exp	18 Oct 2004 18:45:19 -0000
*************** proc default_ld_assemble { as source obj
*** 294,300 ****
  	return 1
      } else {
  	verbose -log "$exec_output"
! 	perror "$source: assembly failed"
  	return 0
      }
  }
--- 294,300 ----
  	return 1
      } else {
  	verbose -log "$exec_output"
! 	warning "$source: assembly failed"
  	return 0
      }
  }
Index: exclude.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/exclude.exp,v
retrieving revision 1.1
diff -c -p -r1.1 exclude.exp
*** exclude.exp	16 Oct 2004 18:13:54 -0000	1.1
--- exclude.exp	18 Oct 2004 18:44:12 -0000
*************** set test9 "ld don't exclude symbols from
*** 46,52 ****

  if { ![ld_assemble $as $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
       || ![ld_assemble $as $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
!     unresolved $test1
      return
  }

--- 46,52 ----

  if { ![ld_assemble $as $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
       || ![ld_assemble $as $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
!     unsupported $test1
      return
  }


brgds, H-P



More information about the Binutils mailing list