Committed: missing ld-cris adjustment. Also, an objdump wart.

Hans-Peter Nilsson
Thu Aug 11 16:01:00 GMT 2005

My autotester has complained for a while due to a change in
toplevel Makefile requiring makeinfo 4.2 but makeinfo 4.0 was
installed, so you'd see
make[2]: *** [/h/hp/binutils/cvs_latest/src/bfd/doc/] Error 1
with the "missing makeinfo" output above it.
Since the error was for a CVS build and info file supposedly are
present in releases, I'm not bothering to fix the wart that
toplevel thinks it knows best what texinfo version is good for

However, the broken build masked this testsuite error:

/n/asic_slask/hp/autobinutest/ld/../binutils/objdump  -d tmpdir/dump > tmpdir/dump.out
regexp_diff match failure
regexp "^   a:	bf0e f6ff ffff      	ba 0 <(a|___init__start)>$"
line   "   a:	bf0e f6ff ffff      	ba 0 <__Stext>"
FAIL: ld-cris/v32-ba-1

Right now, I just fixed the test-suite; the test isn't intended
to check for proper symbol in the disassembly.

But I really don't like the spurious change to display "__Stext"
instead of "a" and that this part of the testsuite wasn't
adjusted or note given that adjustment was needed.  Looks like
it's due to the some of the various section pruning/symbol-
keeping changes that's happened lately.  Besides, objdump hasn't
changed.  "readelf -s" gives:

    15: 00000000     0 NOTYPE  GLOBAL DEFAULT    1 a
    16: 00000000     0 NOTYPE  GLOBAL DEFAULT  ABS ___init__start
    17: 00000000     0 NOTYPE  GLOBAL DEFAULT  ABS __Stext

IMHO it's more proper to display the non-absolute global
section-bound symbol "a" (even though it's untyped) instead of
an absolute symbol (and linker-generated at that).  I think it'd
be pretty simple to adjust objdump.c:find_symbol_for_address to
do that.  Thoughts?

BTW, it seems there's both redundant code copying and missing
bfd_octets_per_byte adjustment in that function:

  if (sorted_syms[thisplace]->section != sec
      && (aux->require_sec
	  || ((abfd->flags & HAS_RELOC) != 0
	      && vma >= bfd_get_section_vma (abfd, sec)
	      && vma < (bfd_get_section_vma (abfd, sec)
			+ bfd_section_size (abfd, sec) / opb))))
      if (sorted_syms[thisplace]->section != sec
	  && (aux->require_sec
	      || ((abfd->flags & HAS_RELOC) != 0
		  && vma >= bfd_get_section_vma (abfd, sec)
		  && vma < (bfd_get_section_vma (abfd, sec)
			    + bfd_section_size (abfd, sec)))))
	/* There is no suitable symbol.  */
	return NULL;

The second arm of the && in the second test seems redundant; I
see none of its components changed in the "...".  And of course
the missing "/ opb".

Back to the committed testsuite patch:

	* ld-cris/v32-ba-1.d: Regexpize to adjust for symbol change.

Index: v32-ba-1.d
RCS file: /cvs/src/src/ld/testsuite/ld-cris/v32-ba-1.d,v
retrieving revision 1.2
diff -u -p -r1.2 v32-ba-1.d
--- v32-ba-1.d	8 Mar 2005 02:31:40 -0000	1.2
+++ v32-ba-1.d	11 Aug 2005 15:52:14 -0000
@@ -14,5 +14,5 @@ Disassembly of section \.text:
 0+8 <b>:
    8:	4312                	moveq 3,r1
-   a:	bf0e f6ff ffff      	ba 0 <(a|___init__start)>
+   a:	bf0e f6ff ffff      	ba 0 <[^>]*>
   10:	4db2                	moveq 13,r11

brgds, H-P

More information about the Binutils mailing list