From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 85B5039730F9 for ; Wed, 2 Jun 2021 19:17:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 85B5039730F9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sTYy+2wygnYaO2unLoOI31i/CHI9SUnSmbLlwfNfyTQ=; b=Z3yUg7MljZljFOgGziUz9rklc8 ljd38U8RoQ+xe/HZtwoC3BvNFHdBRvXVP2rgd9vg+rQS2Wx7EaO4b2+3coOBY9Ou1ag9A0REDHKzk jQJmDHM54w49plzT56LTPTpwlB7F+fkTU07Jgcgn5jTdzlFg87B+fFtpoZcl8bx6WrUHDzuQfIGuW 3umevVEUKF/GxBET35J/fuqgQiCGvKVE6vOjhMaMJkVxggtU6emko/f059Bvs86zylmwKqEZxxEG4 H3JrwD/pyIV2Sp0HoFGXuwX+6oscQl/2SmVZoxSnT3n/Y0pAC1Q7hn40TKkYfYbkCgf7I6pmv+OwM e36uJoug==; Received: from [95.87.234.74] (port=39504 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1loWMK-0007TF-83; Wed, 02 Jun 2021 22:17:00 +0300 From: Dimitar Dimitrov To: newlib@sourceware.org Subject: [PATCH] libgloss: pru: Remove sim ld script Date: Wed, 2 Jun 2021 22:16:51 +0300 Message-Id: <20210602191651.57946-1-dimitar@dinux.eu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HAS_X_OUTGOING_SPAM_STAT, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 19:17:03 -0000 Binutils LD default linker script was recently fixed to allow memory sizes to be set via command line. Use this feature to remove the special sim linker script in libgloss. It is acceptable to require newer Binutils version here because simulator target is only used for regression testing the toolchain. Real HW targets are not affected. Signed-off-by: Dimitar Dimitrov --- libgloss/pru/Makefile.in | 10 +- libgloss/pru/device-specs/sim | 2 +- libgloss/pru/ldscripts/gen-ld-scripts.sh | 80 --------- libgloss/pru/ldscripts/pruelf-sim.x | 200 ----------------------- 4 files changed, 3 insertions(+), 289 deletions(-) delete mode 100755 libgloss/pru/ldscripts/gen-ld-scripts.sh delete mode 100644 libgloss/pru/ldscripts/pruelf-sim.x diff --git a/libgloss/pru/Makefile.in b/libgloss/pru/Makefile.in index 7fdbc0cb5..062c9e5cf 100644 --- a/libgloss/pru/Makefile.in +++ b/libgloss/pru/Makefile.in @@ -64,9 +64,6 @@ RANLIB = @RANLIB@ OBJDUMP = `t='$(program_transform_name)'; echo objdump | sed -e $$t` OBJCOPY = `t='$(program_transform_name)'; echo objcopy | sed -e $$t` -# linker scripts -SCRIPTS = `ls ${srcdir}/ldscripts/*.x` - # object files needed OBJS = \ do_global_dtors.o gettimeofday.o \ @@ -101,10 +98,7 @@ LDFLAGS_FOR_TARGET = ${MULTILIB} .S.o: $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $< -all: ${OUTPUTS} copy_scripts_to_objdir - -copy_scripts_to_objdir: $(srcdir)/ldscripts/gen-ld-scripts.sh - cp $(SCRIPTS) $(objdir) +all: ${OUTPUTS} # # here's where we build the library for each target @@ -130,7 +124,7 @@ distclean maintainer-clean realclean: clean rm -f Makefile config.status $(OUTPUTS) .PHONY: install info install-info clean-info -install: $(OUTPUTS) $(srcdir)/ldscripts/gen-ld-scripts.sh +install: $(OUTPUTS) for outputs in ${OUTPUTS}; do\ ${INSTALL_DATA} $${outputs} ${DESTDIR}${tooldir}/lib${MULTISUBDIR}/$${outputs}; \ done diff --git a/libgloss/pru/device-specs/sim b/libgloss/pru/device-specs/sim index 50d4689e0..049e277aa 100644 --- a/libgloss/pru/device-specs/sim +++ b/libgloss/pru/device-specs/sim @@ -2,4 +2,4 @@ -D__SIM__ *link_device: -%{!r:-Tpruelf-sim.x} +%{!r:--defsym=__IMEM_SIZE=0x40000 --defsym=__DMEM_SIZE=0x4000000 --defsym=__HEAP_SIZE=0x2000000 --defsym=__STACK_SIZE=0x100000} diff --git a/libgloss/pru/ldscripts/gen-ld-scripts.sh b/libgloss/pru/ldscripts/gen-ld-scripts.sh deleted file mode 100755 index ddaf75a7a..000000000 --- a/libgloss/pru/ldscripts/gen-ld-scripts.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: BSD-2-Clause-FreeBSD -# -# Copyright 2018-2019 Dimitar Dimitrov -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -# Generate additional MCU-specific linker scripts by using the -# default PRU-LD linker script. -# -# We do it automatically so that: -# 1. We only change the default linker script in binutils. -# 2. All the default script complexity stays in binutils. -# 3. Here in libgloss we only bump the memory sizes to -# allow large test programs to be executed. - -dump_modified() -{ - IMEM_SIZE=$1 - DMEM_SIZE=$2 - HEAP_SIZE=$3 - STACK_SIZE=$4 - - echo "/* WARNING: automatically generated from the default pru-ld script! */" - echo -e "\n\n" - pru-ld --verbose | awk " -BEGIN { LDV_MARKER = 0; } -{ - if (\$0 == \"==================================================\" ) - { - LDV_MARKER++; - } - else if (LDV_MARKER != 1) - { - } - else if (\$0 ~ /^ imem.*ORIGIN =.*LENGTH =/) - { - print \" imem (x) : ORIGIN = 0x20000000, LENGTH = $IMEM_SIZE\" - } - else if (\$0 ~ /^ dmem.*ORIGIN =.*LENGTH =/) - { - print \" dmem (rw!x) : ORIGIN = 0x0, LENGTH = $DMEM_SIZE\" - } - else if (\$0 ~ /^__HEAP_SIZE = DEFINED/) - { - print \"__HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : $HEAP_SIZE ;\"; - } - else if (\$0 ~ /^__STACK_SIZE = DEFINED/) - { - print \"__STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : $STACK_SIZE ;\"; - } - else - { - print \$0; - } -}" -} - -# IMEM DMEM HEAP_SIZE STACK_SIZE -dump_modified 256K 65536K "32 * 1024 * 1024" "1024 * 1024" | tee pruelf-sim.x diff --git a/libgloss/pru/ldscripts/pruelf-sim.x b/libgloss/pru/ldscripts/pruelf-sim.x deleted file mode 100644 index 1dc8b4f2e..000000000 --- a/libgloss/pru/ldscripts/pruelf-sim.x +++ /dev/null @@ -1,200 +0,0 @@ -/* WARNING: automatically generated from the default pru-ld script! */ - - - -/* Default linker script, for normal executables */ -OUTPUT_FORMAT("elf32-pru","elf32-pru","elf32-pru") -OUTPUT_ARCH(pru) -MEMORY -{ - imem (x) : ORIGIN = 0x20000000, LENGTH = 256K - dmem (rw!x) : ORIGIN = 0x0, LENGTH = 65536K -} -__HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32 * 1024 * 1024 ; -__STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 1024 * 1024 ; -PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem)); -ENTRY (_start) -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rel.init : { *(.rel.init) } - .rela.init : { *(.rela.init) } - .rel.text : - { - *(.rel.text) - *(.rel.text.*) - *(.rel.text:*) - *(.rel.gnu.linkonce.t*) - } - .rela.text : - { - *(.rela.text) - *(.rela.text.*) - *(.rela.text:*) - *(.rela.gnu.linkonce.t*) - } - .rel.fini : { *(.rel.fini) } - .rela.fini : { *(.rela.fini) } - .rel.rodata : - { - *(.rel.rodata) - *(.rel.rodata.*) - *(.rel.rodata:*) - *(.rel.gnu.linkonce.r*) - } - .rela.rodata : - { - *(.rela.rodata) - *(.rela.rodata.*) - *(.rela.rodata:*) - *(.rela.gnu.linkonce.r*) - } - .rel.data : - { - *(.rel.data) - *(.rel.data.*) - *(.rel.data:*) - *(.rel.gnu.linkonce.d*) - } - .rela.data : - { - *(.rela.data) - *(.rela.data.*) - *(.rela.data:*) - *(.rela.gnu.linkonce.d*) - } - .rel.init_array : { *(.rel.init_array) } - .rela.init_array : { *(.rela.init_array) } - .rel.fini_array : { *(.rel.fini_array) } - .rela.fini_array : { *(.rela.fini_array) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - /* Internal text space. */ - .text : - { - _text_start = . ; - . = ALIGN(4); - *(.init0) /* Start here after reset. */ - KEEP (*(.init0)) - . = ALIGN(4); - *(.text) - . = ALIGN(4); - *(.text.*) - . = ALIGN(4); - *(.text:*) - . = ALIGN(4); - *(.gnu.linkonce.t*) - . = ALIGN(4); - _text_end = . ; - } > imem - .data : - { - /* Optional variable that user is prepared to have NULL address. */ - *(.data.atzero*) - /* CRT is prepared for constructor/destructor table to have - a "valid" NULL address. */ - __init_array_start = . ; - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) - KEEP (*(.init_array)) - __init_array_end = . ; - __fini_array_start = . ; - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) - KEEP (*(.fini_array)) - __fini_array_end = . ; - /* DATA memory starts at address 0. So to avoid placing a valid static - variable at the invalid NULL address, we introduce the .data.atzero - section. If CRT can make some use of it - great. Otherwise skip a - word. In all cases .data/.bss sections must start at non-zero. */ - . += (. == 0 ? 4 : 0); - PROVIDE (_data_start = .) ; - *(.data) - *(.data*) - *(.data:*) - *(.rodata) /* We need to include .rodata here if gcc is used. */ - *(.rodata.*) /* with -fdata-sections. */ - *(.rodata:*) - *(.gnu.linkonce.d*) - *(.gnu.linkonce.r*) - . = ALIGN(4); - PROVIDE (_data_end = .) ; - } > dmem - .resource_table : - { - KEEP (*(.resource_table)) - } > dmem - .bss : - { - PROVIDE (_bss_start = .) ; - *(.bss) - *(.bss.*) - *(.bss:*) - *(.gnu.linkonce.b*) - *(COMMON) - PROVIDE (_bss_end = .) ; - } > dmem - /* Global data not cleared after reset. */ - .noinit : - { - PROVIDE (_noinit_start = .) ; - *(.noinit) - PROVIDE (_noinit_end = .) ; - PROVIDE (_heap_start = .) ; - . += __HEAP_SIZE ; - /* Stack is not here really. It will be put at the end of DMEM. - But we take into account its size here, in order to allow - for MEMORY overflow checking during link time. */ - . += __STACK_SIZE ; - } > dmem - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .note.gnu.build-id : { *(.note.gnu.build-id) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } - /* DWARF Extension. */ - .debug_macro 0 : { *(.debug_macro) } - .debug_addr 0 : { *(.debug_addr) } -} - - -- 2.31.1