This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: adapting newlib for a certain target board (memory, STDOUT, ...)?


To fully override the memory map, you can pass a linker script to ld
using the -T option.

If your target uses libgloss, do not link against your target's
standard libgloss. You can then provide your own version of _write
(stdout and stderr) and _read (stdin). You can use -lnosys to provide
dummy stubs (errno = ENOSYS) for the system calls you don't require.

Cheers,
Shaun

On 4/27/06, Torsten Mohr <tmohr@s.netic.de> wrote:
> Hi,
>
> i just configured and compiled a toolchain for an embedded target,
> a V850E in detail.
>
> I want to write some programs for that target, but i don't know
> how to tell newlib what the memory layout is.
>
> When linking i give some options like:
>
> $(F_ELF) $(F_MAP) : $(OBJ)
>         $(CC) -o $(F_ELF) \
>         -Wl,-Map=$(F_MAP) \
>         -Wl,--section-start=.vectors=0x000000 \
>         -Wl,--section-start=.text=0x000640 \
>         -Wl,--section-start=.data=0x03ffe000 \
>         -Wl,--section-start=.stack=0x03fffc00 \
>         $(OBJ)
>
> But i don't know how to tell where the memory ends.
> malloc() is based on sbrk(), right?  sbrk() seems to
> start at "_end".  How can i tell it how much memory
> there is?
>
>
> Another question, i'd like to use printf() and relatives.
>
> How do i tell newlib where to dump the characters that are meant
> for STDOUT?
>
> And what about STDIN and STDERR?
>
> Is there already some description on how to handle this available?
>
>
> Best regards,
> Torsten.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]