From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17950 invoked by alias); 22 Mar 2002 15:25:50 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 17833 invoked from network); 22 Mar 2002 15:25:46 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 22 Mar 2002 15:25:46 -0000 Received: from localhost.cygnus.com (rtl.cygnus.com [205.180.230.21]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id HAA00417; Fri, 22 Mar 2002 07:25:35 -0800 (PST) Message-Id: <200203221525.HAA00417@cygnus.com> To: rearnsha@arm.com Cc: binutils@sources.redhat.com, hunt@cygnus.com, clm@cygnus.com From: Catherine Moore Subject: mips .bss lma broken Date: Fri, 22 Mar 2002 07:25:00 -0000 X-SW-Source: 2002-03/txt/msg00437.txt.bz2 Richard, This patch seems to have caused some trouble for some mips platforms: http://sources.redhat.com/ml/binutils/2001-10/msg00541.html 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 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