Cleanups for pru target

Message ID 1784145.tdWV9SEqCh@dinux-standardpcq35ich92009
State New
Headers show
Series
  • Cleanups for pru target
Related show

Commit Message

Dimitar Dimitrov June 4, 2021, 8:37 p.m.
Hi,

I'm attaching two improvements to help the PRU target with --gc-sections, and 
one cleanup allowed by a recent Binutils change.

Regards,
Dimitar


Dimitar Dimitrov (3):
  libgloss: pru: Remove sim ld script
  pru: Enable -ffunction-sections and -fdata-sections
  libgloss: pru: Place sim syscalls into their own sections

 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 -----------------------
 libgloss/pru/syscalls.S                  |   4 +-
 newlib/configure.host                    |   1 +
 6 files changed, 6 insertions(+), 291 deletions(-)
 delete mode 100755 libgloss/pru/ldscripts/gen-ld-scripts.sh
 delete mode 100644 libgloss/pru/ldscripts/pruelf-sim.x

Comments

Jeff Johnston June 9, 2021, 6:17 p.m. | #1
Thanks Dimitar.  Patches applied.

-- Jeff J.

On Fri, Jun 4, 2021 at 4:38 PM Dimitar Dimitrov <dimitar@dinux.eu> wrote:

> Hi,

>

> I'm attaching two improvements to help the PRU target with --gc-sections,

> and

> one cleanup allowed by a recent Binutils change.

>

> Regards,

> Dimitar

>

>

> Dimitar Dimitrov (3):

>   libgloss: pru: Remove sim ld script

>   pru: Enable -ffunction-sections and -fdata-sections

>   libgloss: pru: Place sim syscalls into their own sections

>

>  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 -----------------------

>  libgloss/pru/syscalls.S                  |   4 +-

>  newlib/configure.host                    |   1 +

>  6 files changed, 6 insertions(+), 291 deletions(-)

>  delete mode 100755 libgloss/pru/ldscripts/gen-ld-scripts.sh

>  delete mode 100644 libgloss/pru/ldscripts/pruelf-sim.x

>

Patch

From 5f831e406cf6ba9ee0b48e56bf30d2281c1e32a4 Mon Sep 17 00:00:00 2001
From: Dimitar Dimitrov <dimitar@dinux.eu>
Date: Sun, 9 May 2021 16:11:36 +0300
Subject: [PATCH] pru: Enable -ffunction-sections and -fdata-sections

Recent binutils support --gc-sections for pru, so let's make use of
them.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 newlib/configure.host | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/configure.host b/newlib/configure.host
index 38fec0597..4ac53342a 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -303,6 +303,7 @@  case "${host_cpu}" in
 	newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED"
 	newlib_cflags="${newlib_cflags} -DNO_EXEC"
 	newlib_cflags="${newlib_cflags} -DSMALL_MEMORY"
+	newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
 	default_newlib_nano_malloc="yes"
 	default_newlib_atexit_dynamic_alloc="no"
 	machine_dir=pru
-- 
2.31.1