[RFC PATCH 2/5] riscv: Address differences in the linkerscript between GNU LD and LLVM/LLD

Hesham Almatary hesham.almatary at cl.cam.ac.uk
Thu Oct 24 09:15:48 UTC 2019


On Thu, 24 Oct 2019 at 09:58, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> On 23/10/2019 15:44, Hesham Almatary wrote:
> > LLVM/LLD does not support STARTUP and ALIGN_WITH_INPUT directives that
> > GNU LD support. INPUT and ALIGN(8) are supported by LLVM/LLD and can
> > replace the unsupported STARTUP/ALIGN_WITH_INPUT directives.
> >
> > The commit conditionally adds the supported directive that linkers
> > can understand depending on the toolchain used to compile RTEMS
> > i.e., clang or gcc. Clang is assumed to use LLD by default.
> > ---
> >   bsps/riscv/shared/start/linkcmds.base.in  | 102 +++++++++++-----------
> >   c/src/lib/libbsp/riscv/riscv/configure.ac |  13 +++
> >   2 files changed, 64 insertions(+), 51 deletions(-)
> >
> > diff --git a/bsps/riscv/shared/start/linkcmds.base.in b/bsps/riscv/shared/start/linkcmds.base.in
> > index 7d889ab38c..857bf2dabd 100644
> > --- a/bsps/riscv/shared/start/linkcmds.base.in
> > +++ b/bsps/riscv/shared/start/linkcmds.base.in
> > @@ -33,7 +33,7 @@
> >
> >   OUTPUT_ARCH(riscv)
> >   ENTRY(_start)
> > -STARTUP(start.o)
> > + at RISCV_LINKER_START_DIRECTIVE@(start.o)
>
> Works INPUT() instead of STARTUP() with GNU ld as well?
>
Unfortunately not. It complains about undefined references in start.o
(because of the un(order) the libs and start.o are linked)
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list