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]

[RFA 2.12:] Committed, MMIX: Pass objcopy tests.


This patch lets mmix-knuth-mmixware pass "simple objcopy of
executable", and other objcopy tests that use gcc, though a
tweak to the testsuite is needed for "run stripped executable
with saving a symbol" (film at 11).

I'd like to install this on the 2.12 branch too, since it fixes
a bug with outputting sections (sec-7m.d).  Ok?

bfd:
	* mmo.c: Correct and improve comments.
	(mmo_write_chunk): Store trailing byte in bfd buffer; don't
	zero-pad.  Use input to fill up non-empty bfd buffer.
	(mmo_flush_chunk): New function.
	(mmo_write_loc_chunk): Add parameter last_vmap, all callers
	changed.  Don't emit location specifier if VMA is same as
	*LAST_VMAP after omitting leading zero contents.  Call
	mmo_flush_chunk before emitting location specifier.
	(mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
	with mmo_write_loc_chunk calls.
	(mmo_internal_write_section): Call mmo_flush_chunk after
	mmo_write_chunk.
	(mmo_write_symbols_and_terminator): Move :Main to first position
	in symbol array.  Add faked one if it does not exist if there are
	other symbols.  Don't add it if there are no symbols at all.  Move
	out test for value of :Main from symbol loop.  Rename table
	fakemain to maintable and variable mainsym to fakemain.

ld/testsuite:

	* ld-mmix/b-nosym.d, ld-mmix/sec-6.d: Tweak for change in symbol
	output.
	* ld-mmix/sec-7m.d, ld-mmix/sec-7a.s, ld-mmix/sec-7b.s,
	ld-mmix/sec-7c.s, ld-mmix/sec-7d.s, ld-mmix/sec-7e.s: New test.

Index: mmo.c
===================================================================
RCS file: /cvs/src/src/bfd/mmo.c,v
retrieving revision 1.4
diff -p -c -r1.4 mmo.c
*** mmo.c	2002/02/01 08:18:56	1.4
--- mmo.c	2002/02/17 19:05:09
*************** static void mmo_write_octa PARAMS ((bfd
*** 405,412 ****
  static void mmo_write_octa_raw PARAMS ((bfd *, bfd_vma));
  static boolean mmo_write_chunk
    PARAMS ((bfd *, CONST bfd_byte *, unsigned int));
  static boolean mmo_write_loc_chunk
!   PARAMS ((bfd *, bfd_vma, CONST bfd_byte *, unsigned int));
  static boolean mmo_write_chunk_list PARAMS ((bfd *, mmo_data_list_type *));
  static boolean mmo_write_loc_chunk_list
    PARAMS ((bfd *, mmo_data_list_type *));
--- 405,413 ----
  static void mmo_write_octa_raw PARAMS ((bfd *, bfd_vma));
  static boolean mmo_write_chunk
    PARAMS ((bfd *, CONST bfd_byte *, unsigned int));
+ static boolean mmo_flush_chunk PARAMS ((bfd *));
  static boolean mmo_write_loc_chunk
!   PARAMS ((bfd *, bfd_vma, CONST bfd_byte *, unsigned int, bfd_vma *));
  static boolean mmo_write_chunk_list PARAMS ((bfd *, mmo_data_list_type *));
  static boolean mmo_write_loc_chunk_list
    PARAMS ((bfd *, mmo_data_list_type *));
*************** mmo_write_octa_raw (abfd, value)
*** 812,818 ****
    mmo_write_tetra_raw (abfd, (unsigned int) value);
  }

! /* Write quoted contents, zero filled.  */

  static INLINE boolean
  mmo_write_chunk (abfd, loc, len)
--- 813,820 ----
    mmo_write_tetra_raw (abfd, (unsigned int) value);
  }

! /* Write quoted contents.  Intended to be called multiple times in
!    sequence, followed by a call to mmo_flush_chunk.  */

  static INLINE boolean
  mmo_write_chunk (abfd, loc, len)
*************** mmo_write_chunk (abfd, loc, len)
*** 821,828 ****
       unsigned int len;
  {
    boolean retval = true;
-   bfd_byte buf[4] = {0, 0, 0, 0};

    while (len >= 4)
      {
        if (loc[0] == LOP)
--- 823,846 ----
       unsigned int len;
  {
    boolean retval = true;

+   /* Fill up a tetra from bytes remaining from a previous chunk.  */
+   if (abfd->tdata.mmo_data->byte_no != 0)
+     {
+       while (abfd->tdata.mmo_data->byte_no < 4 && len != 0)
+ 	{
+ 	  abfd->tdata.mmo_data->buf[abfd->tdata.mmo_data->byte_no++] = *loc++;
+ 	  len--;
+ 	}
+
+       if (abfd->tdata.mmo_data->byte_no == 4)
+ 	{
+ 	  mmo_write_tetra (abfd,
+ 			   bfd_get_32 (abfd, abfd->tdata.mmo_data->buf));
+ 	  abfd->tdata.mmo_data->byte_no = 0;
+ 	}
+     }
+
    while (len >= 4)
      {
        if (loc[0] == LOP)
*************** mmo_write_chunk (abfd, loc, len)
*** 839,857 ****

    if (len)
      {
!       memcpy (buf, loc, len);
!       if (buf[0] == LOP)
! 	mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT);
!
!       retval
! 	= (retval == true
! 	   && abfd->tdata.mmo_data->have_error == false
! 	   && 4 == bfd_bwrite ((PTR) buf, 4, abfd));
      }

    return retval;
  }

  /* Same, but from a list.  */

  static INLINE boolean
--- 857,890 ----

    if (len)
      {
!       memcpy (abfd->tdata.mmo_data->buf, loc, len);
!       abfd->tdata.mmo_data->byte_no = len;
      }

+   if (retval == false)
+     abfd->tdata.mmo_data->have_error = true;
    return retval;
  }

+ /* Flush remaining bytes, from a previous mmo_write_chunk, zero-padded to
+    4 bytes.  */
+
+ static INLINE boolean
+ mmo_flush_chunk (abfd)
+      bfd *abfd;
+ {
+   if (abfd->tdata.mmo_data->byte_no != 0)
+     {
+       memset (abfd->tdata.mmo_data->buf + abfd->tdata.mmo_data->byte_no,
+ 	      0, 4 - abfd->tdata.mmo_data->byte_no);
+       mmo_write_tetra (abfd,
+ 		       bfd_get_32 (abfd, abfd->tdata.mmo_data->buf));
+       abfd->tdata.mmo_data->byte_no = 0;
+     }
+
+   return abfd->tdata.mmo_data->have_error == false;
+ }
+
  /* Same, but from a list.  */

  static INLINE boolean
*************** mmo_write_chunk_list (abfd, datap)
*** 863,886 ****
      if (! mmo_write_chunk (abfd, datap->data, datap->size))
        return false;

!   return true;
  }

! /* Write a lop_loc and some contents.  */

  static boolean
! mmo_write_loc_chunk (abfd, vma, loc, len)
       bfd *abfd;
       bfd_vma vma;
       CONST bfd_byte *loc;
       unsigned int len;
  {
-   /* We always write the location as 64 bits; no use saving bytes here.  */
-   mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_LOC << 16) | 2);
-
    /* Find an initial and trailing section of zero tetras; we don't need to
       write out zeros.  FIXME: When we do this, we should emit section size
!      and address specifiers, else objcopy can't perform a unity
       translation.  */
    while (len >= 4 && bfd_get_32 (abfd, loc) == 0)
      {
--- 896,919 ----
      if (! mmo_write_chunk (abfd, datap->data, datap->size))
        return false;

!   return mmo_flush_chunk (abfd);
  }

! /* Write a lop_loc and some contents.  A caller needs to call
!    mmo_flush_chunk after calling this function.  The location is only
!    output if different than *LAST_VMAP, which is updated after this call.  */

  static boolean
! mmo_write_loc_chunk (abfd, vma, loc, len, last_vmap)
       bfd *abfd;
       bfd_vma vma;
       CONST bfd_byte *loc;
       unsigned int len;
+      bfd_vma *last_vmap;
  {
    /* Find an initial and trailing section of zero tetras; we don't need to
       write out zeros.  FIXME: When we do this, we should emit section size
!      and address specifiers, else objcopy can't always perform an identity
       translation.  */
    while (len >= 4 && bfd_get_32 (abfd, loc) == 0)
      {
*************** mmo_write_loc_chunk (abfd, vma, loc, len
*** 891,898 ****

    while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0)
      len -= 4;

!   mmo_write_octa_raw (abfd, vma);
    return
      abfd->tdata.mmo_data->have_error == false
      && mmo_write_chunk (abfd, loc, len);
--- 924,946 ----

    while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0)
      len -= 4;
+
+   /* Only write out the location if it's different than the one the caller
+      (supposedly) previously handled, accounting for omitted leading zeros.  */
+   if (vma != *last_vmap)
+     {
+       /* We might be in the middle of a sequence.  */
+       mmo_flush_chunk (abfd);

!       /* We always write the location as 64 bits; no use saving bytes
!          here.  */
!       mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_LOC << 16) | 2);
!       mmo_write_octa_raw (abfd, vma);
!     }
!
!   /* Update to reflect end of this chunk, with trailing zeros omitted.  */
!   *last_vmap = vma + len;
!
    return
      abfd->tdata.mmo_data->have_error == false
      && mmo_write_chunk (abfd, loc, len);
*************** mmo_write_loc_chunk_list (abfd, datap)
*** 905,915 ****
       bfd *abfd;
       mmo_data_list_type *datap;
  {
    for (; datap != NULL; datap = datap->next)
!     if (! mmo_write_loc_chunk (abfd, datap->where, datap->data, datap->size))
        return false;

!   return true;
  }

  /* Make a .MMIX.spec_data.N section.  */
--- 953,967 ----
       bfd *abfd;
       mmo_data_list_type *datap;
  {
+   /* Get an address different than the address of the first chunk.  */
+   bfd_vma last_vma = datap ? datap->where - 1 : 0;
+
    for (; datap != NULL; datap = datap->next)
!     if (! mmo_write_loc_chunk (abfd, datap->where, datap->data, datap->size,
! 			       &last_vma))
        return false;

!   return mmo_flush_chunk (abfd);
  }

  /* Make a .MMIX.spec_data.N section.  */
*************** mmo_get_loc (sec, vma, size)
*** 1425,1430 ****
--- 1477,1484 ----
    struct mmo_data_list_struct *datap = sdatap->head;
    struct mmo_data_list_struct *entry;

+   /* First search the list to see if we have the requested chunk in one
+      piece, or perhaps if we have a suitable chunk with room to fit.  */
    for (; datap != NULL; datap = datap->next)
      {
        if (datap->where <= vma
*************** mmo_get_loc (sec, vma, size)
*** 1440,1446 ****
  	     it.  Do that now.  */
  	  datap->size += (vma + size) - (datap->where + datap->size);

! 	  /* Update the section size.  */
  	  if (vma + size > sec->vma + sec->_raw_size)
  	    sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size);

--- 1494,1504 ----
  	     it.  Do that now.  */
  	  datap->size += (vma + size) - (datap->where + datap->size);

! 	  /* Update the section size.  This happens only if we update the
! 	     32-bit-aligned chunk size.  Callers that have
! 	     non-32-bit-aligned sections should do all allocation and
! 	     size-setting by themselves or at least set the section size
! 	     after the last allocating call to this function.  */
  	  if (vma + size > sec->vma + sec->_raw_size)
  	    sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size);

*************** mmo_get_loc (sec, vma, size)
*** 1502,1508 ****
  	}
      }

!   /* Update the section size.  */
    if (vma + size > sec->vma + sec->_raw_size)
      sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size);
    return entry->data;
--- 1560,1567 ----
  	}
      }

!   /* Update the section size.  This happens only when we add contents and
!      re-size as we go.  The section size will then be aligned to 32 bits.  */
    if (vma + size > sec->vma + sec->_raw_size)
      sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size);
    return entry->data;
*************** EXAMPLE
*** 2449,2456 ****
  | 0x00000000 - high 32 bits of section address
  | 0x00000004 - section address is 4
  | 0x98010002 - 64 bits with address of following data
! | 0x00000000 - high 64 bits of address
! | 0x00000004 - data starts at address 4
  | 0x00000001 - 1
  | 0x00000002 - 2
  | 0x00000003 - 3
--- 2508,2515 ----
  | 0x00000000 - high 32 bits of section address
  | 0x00000004 - section address is 4
  | 0x98010002 - 64 bits with address of following data
! | 0x00000000 - high 32 bits of address
! | 0x00000004 - low 32 bits: data starts at address 4
  | 0x00000001 - 1
  | 0x00000002 - 2
  | 0x00000003 - 3
*************** EXAMPLE
*** 2476,2488 ****
  | 0x00000010 - flag READONLY
  | 0x00000000 - high 32 bits of section length
  | 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits
! | 0x20000000 - high 64 bits of address
! | 0x0000001c - low 64 bits of address 0x200000000000001c
  | 0x00030d41 - 200001
  | 0x000186a2 - 100002
  | 0x26280000 - 38, 40 as bytes, padded with zeros

! 	For the latter example, the section contents must not to appear
  	loaded in memory, and is therefore specified as part of the
  	special data.  The address is usually unimportant but might
  	provide information for e.g.@: the DWARF 2 debugging format.  */
--- 2535,2547 ----
  | 0x00000010 - flag READONLY
  | 0x00000000 - high 32 bits of section length
  | 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits
! | 0x20000000 - high 32 bits of address
! | 0x0000001c - low 32 bits of address 0x200000000000001c
  | 0x00030d41 - 200001
  | 0x000186a2 - 100002
  | 0x26280000 - 38, 40 as bytes, padded with zeros

! 	For the latter example, the section contents must not be
  	loaded in memory, and is therefore specified as part of the
  	special data.  The address is usually unimportant but might
  	provide information for e.g.@: the DWARF 2 debugging format.  */
*************** EXAMPLE
*** 2490,2495 ****
--- 2549,2555 ----
        mmo_write_tetra_raw (abfd, LOP_SPEC_SECTION);
        mmo_write_tetra (abfd, (strlen (sec->name) + 3) / 4);
        mmo_write_chunk (abfd, sec->name, strlen (sec->name));
+       mmo_flush_chunk (abfd);
        /* FIXME: We can get debug sections (.debug_line & Co.) with a
  	 section flag still having SEC_RELOC set.  Investigate.  This
  	 might be true for all alien sections; perhaps mmo.em should clear
*************** mmo_internal_3_dump (abfd, trie)
*** 2785,2832 ****
    mmo_internal_3_dump (abfd, trie->right);
  }

! /* Write symbols, either in mmo format or hidden in a lop_spec 80 section.
!    Write the lop_end terminator also.  */

  static boolean
  mmo_write_symbols_and_terminator (abfd)
       bfd *abfd;
  {
    int count = bfd_get_symcount (abfd);
!   asymbol *fakemain[2];
    asymbol **table;
!   int serno = 2;
    struct mmo_symbol_trie root;
    int trie_len;
    int i;
    bfd_byte buf[4];

    /* Create a symbol for "Main".  */
!   asymbol *mainsym = bfd_make_empty_symbol (abfd);

!   mainsym->flags = BSF_GLOBAL;
!   mainsym->value = bfd_get_start_address (abfd);
!   mainsym->name = MMIX_START_SYMBOL_NAME;
!   mainsym->section = bfd_abs_section_ptr;
!   fakemain[0] = mainsym;
!   fakemain[1] = NULL;

    memset (&root, 0, sizeof (root));

    /* Make all symbols take a left turn.  */
    root.symchar = 0xff;

!   /* There must always be a ":Main", so we'll add one
!      if there are no symbols.  */
!   if (count == 0)
!     {
!       table = fakemain;
!       count = 1;
      }
-   else
-     table = bfd_get_outsymbols (abfd);

!   for (i = 0; i < count && table[i] != NULL; i++)
      {
        asymbol *s = table[i];

--- 2845,2939 ----
    mmo_internal_3_dump (abfd, trie->right);
  }

! /* Write symbols in mmo format.  Also write the lop_end terminator.  */

  static boolean
  mmo_write_symbols_and_terminator (abfd)
       bfd *abfd;
  {
    int count = bfd_get_symcount (abfd);
!   asymbol *maintable[2];
    asymbol **table;
!   asymbol **orig_table = bfd_get_outsymbols (abfd);
!   int serno;
    struct mmo_symbol_trie root;
    int trie_len;
    int i;
    bfd_byte buf[4];

    /* Create a symbol for "Main".  */
!   asymbol *fakemain = bfd_make_empty_symbol (abfd);

!   fakemain->flags = BSF_GLOBAL;
!   fakemain->value = bfd_get_start_address (abfd);
!   fakemain->name = MMIX_START_SYMBOL_NAME;
!   fakemain->section = bfd_abs_section_ptr;
!   maintable[0] = fakemain;
!   maintable[1] = NULL;

    memset (&root, 0, sizeof (root));

    /* Make all symbols take a left turn.  */
    root.symchar = 0xff;

!   /* There must always be a ":Main", so we'll add one if there are no
!      symbols.  Make sure we have room for it.  */
!   table = bfd_alloc (abfd, (count + 1) * sizeof (asymbol *));
!   if (table == NULL)
!     return false;
!
!   memcpy (table, orig_table, count * sizeof (asymbol *));
!
!   /* Move :Main (if there is one) to the first position.  This is
!      necessary to get the same layout of the trie-tree when linking as
!      when objcopying the result as in the objcopy.exp test "simple objcopy
!      of executable".  It also automatically takes care of assigning serial
!      number 1 to :Main (as is mandatory).  */
!   for (i = 0; i < count; i++)
!     if (table[i] != NULL
! 	&& strcmp (table[i]->name, MMIX_START_SYMBOL_NAME) == 0
! 	&& (table[i]->flags & (BSF_DEBUGGING|BSF_GLOBAL)) == BSF_GLOBAL)
!       {
! 	asymbol *mainsym = table[i];
! 	memcpy (table + 1, orig_table, i * sizeof (asymbol *));
! 	table[0] = mainsym;
!
! 	/* Check that the value assigned to :Main is the same as the entry
! 	   address.  The default linker script asserts this.  This is as
! 	   good a place as any to check this consistency. */
! 	if ((mainsym->value
! 	     + mainsym->section->output_section->vma
! 	     + mainsym->section->output_offset)
! 	    != bfd_get_start_address (abfd))
! 	  {
! 	    /* Arbitrary buffer to hold the printable representation of a
! 	       vma.  */
! 	    char vmas_main[40];
! 	    char vmas_start[40];
! 	    bfd_vma vma_start = bfd_get_start_address (abfd);
!
! 	    sprintf_vma (vmas_main, mainsym->value);
! 	    sprintf_vma (vmas_start, vma_start);
!
! 	    (*_bfd_error_handler)
! 	      (_("%s: Bad symbol definition: `Main' set to %s rather\
!  than the start address %s\n"),
! 	       bfd_get_filename (abfd), vmas_main, vmas_start);
! 	    bfd_set_error (bfd_error_bad_value);
! 	    return false;
! 	  }
! 	break;
!       }
!   if (i == count && count != 0)
!     {
!       /* When there are symbols, there must be a :Main.  There was no
! 	 :Main, so we need to add it manually.  */
!       memcpy (table + 1, orig_table, count * sizeof (asymbol *));
!       table[0] = fakemain;
!       count++;
      }

!   for (i = 0, serno = 1; i < count && table[i] != NULL; i++)
      {
        asymbol *s = table[i];

*************** mmo_write_symbols_and_terminator (abfd)
*** 2871,2907 ****
  	  /* FIXME: We assume the order of the received symbols is an
  	     ordered mapping of the serial numbers.  This is not
  	     necessarily true if we e.g. objcopy a mmo file to another and
! 	     there are gaps in the numbering.  Note sure if this can
  	     happen.  Not sure what to do.  */
! 	  /* Make sure Main has serial number 1; others start at 2.  */
! 	  if (strcmp (s->name, MMIX_START_SYMBOL_NAME) == 0)
! 	    {
! 	      sym.serno = 1;
!
! 	      /* Check that the value assigned to :Main is the same as the
! 		 entry address.  The default linker script asserts this.
! 		 This is as good a place as any to check this consistency. */
! 	      if (sym.value != bfd_get_start_address (abfd))
! 		{
! 		  /* Arbitrary buffer to hold the printable representation
! 		     of a vma.  */
! 		  char vmas_main[40];
! 		  char vmas_start[40];
! 		  bfd_vma vma_start = bfd_get_start_address (abfd);
!
! 		  sprintf_vma (vmas_main, s->value);
! 		  sprintf_vma (vmas_start, vma_start);
!
! 		  (*_bfd_error_handler)
! 		    (_("%s: Bad symbol definition: `Main' set to %s rather\
!  than the start address %s\n"),
! 		     bfd_get_filename (abfd), vmas_main, vmas_start);
! 		  bfd_set_error (bfd_error_bad_value);
! 		  return false;
! 		}
! 	    }
! 	  else
! 	    sym.serno = serno++;

  	  if (! mmo_internal_add_3_sym (abfd, &root, &sym))
  	    return false;
--- 2978,2986 ----
  	  /* FIXME: We assume the order of the received symbols is an
  	     ordered mapping of the serial numbers.  This is not
  	     necessarily true if we e.g. objcopy a mmo file to another and
! 	     there are gaps in the numbering.  Not sure if this can
  	     happen.  Not sure what to do.  */
! 	  sym.serno = serno++;

  	  if (! mmo_internal_add_3_sym (abfd, &root, &sym))
  	    return false;
Index: ld-mmix/b-nosym.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mmix/b-nosym.d,v
retrieving revision 1.2
diff -p -c -r1.2 b-nosym.d
*** b-nosym.d	2001/10/31 05:42:51	1.2
--- b-nosym.d	2002/02/17 17:49:06
***************
*** 3,14 ****
  #source: b-nosym.s
  #ld: --oformat binary
  #objcopy_linked_file:
! #objdump: -st

! .*:     file format mmo

! SYMBOL TABLE:
! 0+4 g       \.text Main

  Contents of section \.text:
   0000 e3fd0001 e3fd0004                    .*
--- 3,15 ----
  #source: b-nosym.s
  #ld: --oformat binary
  #objcopy_linked_file:
! #objdump: -st 2>/dev/null

! # Note that we have to redirect stderr when objdumping to get rid of the
! # "no symbols" message that would otherwise cause a spurious failure and
! # which we seemingly can't identify or prune in another way.

! .*:     file format mmo

  Contents of section \.text:
   0000 e3fd0001 e3fd0004                    .*
Index: ld-mmix/sec-6.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mmix/sec-6.d,v
retrieving revision 1.1
diff -p -c -r1.1 sec-6.d
*** sec-6.d	2001/10/30 15:20:14	1.1
--- sec-6.d	2002/02/17 17:49:06
*************** Idx Name          Size      VMA
*** 23,28 ****
--- 23,29 ----
    1 \.debug_frame  0+10  0+  0+  0+  2\*\*2
                    CONTENTS, READONLY, DEBUGGING
  SYMBOL TABLE:
+ 0+ g       \.text Main
  0+ g       \.text _start
  0+8 g       \.text debugb
  2000000000000000 g       \*ABS\* __bss_start
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/sec-7m.d	Sat Feb 16 18:52:05 2002
***************
*** 0 ****
--- 1,38 ----
+ #source: start.s
+ #source: sec-7a.s
+ #source: sec-7b.s
+ #source: sec-7c.s
+ #source: sec-7d.s
+ #source: sec-7e.s
+ #ld: -m mmo
+ #objcopy_linked_file:
+ #objdump: -hs
+
+ # When producing mmo output: sections with an input length not a
+ # multiple of 4, and whose total length in linked output
+ # exceeded the "chunk size" (32768), would get to-4-padding
+ # inserted at each chunk division.  Also check that section
+ # sizes aren't rounded up at objcopy.
+
+ .*:     file format mmo
+
+ Sections:
+ Idx Name[ ]+Size[ ]+VMA[ ]+LMA[ ]+File off  Algn
+   0 \.text[ ]+0+4  0+  0+  0+  2\*\*2
+ [ ]+CONTENTS, ALLOC, LOAD, CODE
+   1 \.debug_info   0+27ffb  0+  0+  0+  2\*\*2
+ [ ]+CONTENTS, READONLY, DEBUGGING
+ Contents of section \.text:
+  0000 e3fd0001[ ]+.*
+ Contents of section \.debug_info:
+  0000 2a000000 00000000 00000000 00000000  .*
+ #...
+  7ff0 00000000 00000000 00000000 2b2c0000  .*
+ #...
+  fff0 00000000 00000000 00002d2e 00000000  .*
+ #...
+  17ff0 00000000 00000000 002f3000 00000000  .*
+ #...
+  1fff0 00000000 00000000 00313200 00000000  .*
+ #...
+  27ff0 00000000 00000000 000033[ ]+.*
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/sec-7a.s	Sat Feb 16 15:55:36 2002
***************
*** 0 ****
--- 1,6 ----
+  .section .debug_info
+  .byte 42
+  .rept 32763
+  .byte 0
+  .endr
+  .byte 43
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/sec-7b.s	Sat Feb 16 15:55:48 2002
***************
*** 0 ****
--- 1,6 ----
+  .section .debug_info
+  .byte 44
+  .rept 32764
+  .byte 0
+  .endr
+  .byte 45
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/sec-7c.s	Sat Feb 16 15:56:14 2002
***************
*** 0 ****
--- 1,6 ----
+  .section .debug_info
+  .byte 46
+  .rept 32765
+  .byte 0
+  .endr
+  .byte 47
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/sec-7d.s	Sat Feb 16 15:57:19 2002
***************
*** 0 ****
--- 1,6 ----
+  .section .debug_info
+  .byte 48
+  .rept 32766
+  .byte 0
+  .endr
+  .byte 49
*** /dev/null	Tue Jan  1 05:00:00 1980
--- ld-mmix/sec-7e.s	Sat Feb 16 15:57:45 2002
***************
*** 0 ****
--- 1,6 ----
+  .section .debug_info
+  .byte 50
+  .rept 32767
+  .byte 0
+  .endr
+  .byte 51

brgds, H-P


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