public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Catherine Moore <clm@redhat.com>
To: rearnsha@arm.com
Cc: binutils@sources.redhat.com, hunt@cygnus.com, clm@cygnus.com
Subject: mips .bss lma broken
Date: Fri, 22 Mar 2002 07:25:00 -0000	[thread overview]
Message-ID: <200203221525.HAA00417@cygnus.com> (raw)

Richard,

This patch seems to have caused some trouble for some
mips platforms:

http://sources.redhat.com/ml/binutils/2001-10/msg00541.html

<date>  Richard Earnshaw (rearnsha@arm.com)

        * elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the
        p_paddr of the segment that contains it.

In particular, the lma for the bss section should be the same value as
the vma.  In this example, it is not, and gdb relies on a correct lma
for this particular port.

 8 .eh_frame     00000350  0001ad30  0001ad30  0000bd30  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  9 .jcr          00000004  0001b080  0001b080  0000c080  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 10 .sbss         00000010  0001b090  0001b090  0000c090  2**3
                  ALLOC
 11 .bss          000001d0  0001b0a0  0001b090  0000c090  2**4
                  ALLOC
 12 .reginfo      00000018  00000000  00000000  0000c090  2**2
                  CONTENTS, READONLY, LINK_ONCE_SAME_SIZE
 13 .mdebug       00027f04  00000000  00000000  0000c0a8  2**2
                  CONTENTS, READONLY, DEBUGGING

I'm not sure if any other targets have more than one section 
that has its type set to SHT_NOBITS.  In this case, the .sbss and
the .bss section have that type.  Maybe the lma calculation needs
to take that into account?

In any case, I don't understand the problem that you were trying
to fix with this patch.  If you would elaborate, then maybe we
could come up with a correct lma calculation for both cases.

This is the source code, used to generate the executable:

#include <stdio.h>
static int x[2];
static char astring[128];
int main ()
{
  int i;
  char *ptr;

  ptr = astring;
  for (i = ' '; i < 'Z'; i++)
    *ptr++ = i;
  *ptr = 0;

  printf ("astring=0x%llx\n", (long long)astring);
  printf ("astring=%s\n", astring);
}


Thanks,
Catherine


             reply	other threads:[~2002-03-22 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-22  7:25 Catherine Moore [this message]
2002-03-22  9:52 ` Richard Earnshaw
2002-03-23  5:12 ` Alan Modra
2002-03-23 11:05   ` Richard Earnshaw
2002-03-23 11:08     ` Daniel Jacobowitz
2002-03-25  1:31       ` Alan Modra
2002-03-28 21:01         ` Daniel Jacobowitz
2002-04-02 16:02           ` Alan Modra
2002-04-02 16:48             ` Daniel Jacobowitz
2002-03-25  6:52   ` Catherine Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200203221525.HAA00417@cygnus.com \
    --to=clm@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=clm@cygnus.com \
    --cc=hunt@cygnus.com \
    --cc=rearnsha@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).