This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed, MMIX: Fix -m mmo --oformat elf64-mmix corner case.


I noticed this corner-case bug by setting GNUTARGET=elf64-mmix
when running the binutils testsuite, to check linking to ELF (in
a somewhat limited way).  Unimportant, not 2.12 material.

ld:
	* emultempl/mmo.em (mmo_after_open): Don't call
	_bfd_mmix_check_all_relocs when producing ELF output.

ld/testsuite:

	* ld-mmix/bpo-22.d: New test.

Index: emultempl/mmo.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/mmo.em,v
retrieving revision 1.4
diff -p -c -r1.4 mmo.em
*** mmo.em	2002/02/01 08:24:02	1.4
--- mmo.em	2002/02/17 19:59:59
*************** mmo_finish ()
*** 238,249 ****
  static void
  mmo_after_open ()
  {
!   LANG_FOR_EACH_INPUT_STATEMENT (is)
      {
!       if (bfd_get_flavour (is->the_bfd) == bfd_target_elf_flavour
! 	  && !_bfd_mmix_check_all_relocs (is->the_bfd, &link_info))
! 	einfo ("%X%P: Internal problems scanning %B after opening it",
! 	       is->the_bfd);
      }
  }
  EOF
--- 238,257 ----
  static void
  mmo_after_open ()
  {
!   /* When there's a mismatch between the output format and the emulation
!      (using weird combinations like "-m mmo --oformat elf64-mmix" for
!      example), we'd count relocs twice because they'd also be counted
!      along the usual route for ELF-only linking, which would lead to an
!      internal accounting error.  */
!   if (bfd_get_flavour (output_bfd) != bfd_target_elf_flavour)
      {
!       LANG_FOR_EACH_INPUT_STATEMENT (is)
! 	{
! 	  if (bfd_get_flavour (is->the_bfd) == bfd_target_elf_flavour
! 	      && !_bfd_mmix_check_all_relocs (is->the_bfd, &link_info))
! 	    einfo ("%X%P: Internal problems scanning %B after opening it",
! 		   is->the_bfd);
! 	}
      }
  }
  EOF
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/bpo-22.d	Sun Feb 17 16:21:10 2002
***************
*** 0 ****
--- 1,28 ----
+ #source: start.s
+ #source: bpo-1.s
+ #as: -linker-allocated-gregs
+ #ld: -m mmo --oformat elf64-mmix
+ #objdump: -st
+
+ # This weird combination of format and emulation options caused hiccups in
+ # the reloc accounting machinery.
+
+ .*:     file format elf64-mmix
+
+ SYMBOL TABLE:
+ 0000000000000000 l    d  \.text	0+
+ 2000000000000000 l    d  \.data	0+
+ 2000000000000000 l    d  \.bss	0+
+ 0+7f0 l    d  \.MMIX\.reg_contents	0+
+ 0+ l    d  \*ABS\*	0+
+ 0+ l    d  \*ABS\*	0+
+ 0+ l    d  \*ABS\*	0+
+ 0+4 l       \.text	0+ x
+ 0+ g       \.text	0+ Main
+ 0+ g       \.text	0+ _start
+
+ Contents of section \.text:
+  0000 e3fd0001 232afe00                    .*
+ Contents of section \.data:
+ Contents of section \.MMIX\.reg_contents:
+  07f0 00000000 0000002e                    .*

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]