Re: RISC-V: GCC crti.S vs. Newlib __libc_init_array()

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On 26/07/18 01:41, Joel Sherrill wrote:
>
>
> On Wed, Jul 25, 2018 at 5:02 AM, Sebastian Huber 
> <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Hello,
>
>     the GCC provided libgcc/config/riscv/crti.S and
>     libgcc/config/riscv/crtn.S files are empty on RISC-V, e.g. they
>     contain no definitions of _init and _fini. This leads to undefined
>     references in Newlib provided __libc_init_array() and
>     __libc_fini_array(). I would like to fix this. Should this be done
>     via some configure test or a __riscv machine define in
>     newlib/libc/misc/init.c and newlib/libc/misc/fini.c?
>
>
> I would lean to a __riscv define in newlib/libc/misc/init.c and fini.c.
>
> But if they need these, why aren't they in gcc? This seems to be covering
> up a gcc issue that would impact non-RTEMS targets.

I think this impacts all Newlib RISC-V users. The _init and _fini are 
NOT needed. See also comment here:

https://gcc.gnu.org/viewcvs/gcc/trunk/libgcc/config/riscv/crti.S?revision=245226&view=markup
https://gcc.gnu.org/viewcvs/gcc/trunk/libgcc/config/riscv/crtn.S?revision=245226&view=markup

-- 
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  : [email protected]
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.