From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120739 invoked by alias); 19 Apr 2017 11:59:24 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 120672 invoked by uid 89); 19 Apr 2017 11:59:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy=satisfactory, ram X-HELO: mail-qt0-f177.google.com Received: from mail-qt0-f177.google.com (HELO mail-qt0-f177.google.com) (209.85.216.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Apr 2017 11:59:16 +0000 Received: by mail-qt0-f177.google.com with SMTP id c45so16682914qtb.1 for ; Wed, 19 Apr 2017 04:59:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+PAPANYWjnTOkhYbeaqfCsG8sLvgXqtuB5cPCptK2Hc=; b=sJ6G5aOKdjxbuZzHa5dpqvLnkAsZB88kcUrX5THFgmhoSxyQyGO7a3EXjo6RiQMTJi /QUlxnAV3S6P6RkRmmGBQgFr+1KVI2vCqsLp04ieffaAszN6h22ZnjZLJvAGqBmw+M9n Ny/T5imaRHMcJQIItThJuD+jUqmcWAQW6EBLcdnx5PtRFB9QYgJ/gXhJX3UyVn4HgLln xumUpwTKrErshbnvttqPG8jmLzww9rVwJFxzpg1mUcBrIs4ihJhspZHqQLatox2R8OJt NeCP1C8cbsHJlqdFfpk42dQtoUNPDSJZkDdFxD9xQ9i5eWECXQQMbu0Tcau2qEJxSJ7v gWjQ== X-Gm-Message-State: AN3rC/4tNyABGK78rw763SyRX1085TbLiFjthfqv+AqgNQ3SqT4njGWi xllSgFnQvb+kOj1wcz6sLTBnCAyyJblw0fw= X-Received: by 10.200.51.28 with SMTP id t28mr2386239qta.16.1492603155867; Wed, 19 Apr 2017 04:59:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.51.103 with HTTP; Wed, 19 Apr 2017 04:58:45 -0700 (PDT) From: Jozef Lawrynowicz Date: Wed, 19 Apr 2017 11:59:00 -0000 Message-ID: Subject: [PATCH] [MSP430] Fix relocation type for _bsssize being R_MSP430X_ABS16 when large memory model is used To: newlib@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017/txt/msg00300.txt.bz2 For the msp430 target, trying to link a program with .bss larger than 64K causes a few different errors to be reported. > /usr/local/bin/../lib/gcc/msp430-elf/6.3.1/../../../../msp430-elf/bin/ld: stone-msp430 section `.bss' will not fit in region `RAM' > /usr/local/bin/../lib/gcc/msp430-elf/6.3.1/../../../../msp430-elf/bin/ld: region `RAM' overflowed by 65906 bytes > /usr/local/bin/../lib/gcc/msp430-elf/6.3.1/../../../../msp430-elf/lib/large/libcrt.a(crt_bss.o): In function `.Loc.75.1': > [...]/msp430-elf/large/libgloss/msp430/../../../../../libgloss/msp430/crt0.S:73:(.crt_0100init_bss+0x8): relocation truncated to fit: R_MSP430X_ABS16 against symbol `__bsssize' defined in *ABS* section in stone-msp430 Even though BSS shouldn't be larger than 64K, the relocation trunated to fit error still looks like a bug. The patch below changes one of the instructions in libgloss/msp430/crt0.S from mov.w to mov_, so that the R_MSP430X_ABS20_A relocation type is used instead of the R_MSP430X_ABS16 for the _bsssize variable when the large memory model is used. I also fixed a typo in a comment. With the patch applied, linking the program with large bss now reports only the following errors: > /usr/local/bin/../lib/gcc/msp430-elf/6.3.1/../../../../msp430-elf/bin/ld: stone-msp430 section `.bss' will not fit in region `RAM' > /usr/local/bin/../lib/gcc/msp430-elf/6.3.1/../../../../msp430-elf/bin/ld: region `RAM' overflowed by 65906 bytes I don't have write access, so if this patch is satisfactory, I would appreciate if someone could commit it for me. >From f79b243fafb2964e4d7b73edcf79dd7c7d087ac9 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Wed, 19 Apr 2017 11:47:13 +0000 Subject: [PATCH] Fix relocation type for _bsssize being R_MSP430X_ABS16 when large memory model is used --- libgloss/msp430/crt0.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgloss/msp430/crt0.S b/libgloss/msp430/crt0.S index 5c84e7c..f5ab8d3 100644 --- a/libgloss/msp430/crt0.S +++ b/libgloss/msp430/crt0.S @@ -72,9 +72,9 @@ START_CRT_FUNC 0100 init_bss mov_ #__bssstart, R12 clr.w R13 - mov.w #__bsssize, R14 + mov_ #__bsssize, R14 #ifdef __MSP430X_LARGE__ - clr.w R15 ; We assume that __bsssize is never > 64M + clr.w R15 ; We assume that __bsssize is never > 64K #endif call_ #memset -- 1.8.3.1