aboutsummaryrefslogtreecommitdiff
path: root/libgloss/arc/crt0.S
AgeCommit message (Collapse)AuthorFilesLines
2024-05-22arc: libgloss: Clean registers before any useYuriy Kolerov1-0/+41
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2024-05-22arc: libgloss: Use atexit to setup fini routinesClaudiu Zissulescu1-20/+5
Use atexit funtion to setup fini routines to be called on exit instead of filling in __atexit structures manually. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2024-05-22arc: libgloss: Introduce hostlink interfaceVladimir Isaev1-8/+18
There is a special interface built in ARC simulators (such as nSIM) called MetaWare hostlink IO which can be used to implement system calls. This commit adds support for this interface to the ARC port of libgloss. Here is an example of using this interface: $ arc-elf32-gcc -mcpu=hs -specs=hl.specs main.c -o main $ nsimdrv -tcf $NSIM_HOME/etc/tcf/templates/hs48_full.tcf main Hello, World! Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
2024-05-22arc: libc, libgloss: Remove .file directive from .S filesYuriy Kolerov1-2/+1
Assembler for ARCv2 always extends the name provided by .file directive to an absolute form. On ARCv3 targets .file directive forces assembler to put a provided string to DW_AT_name field as is without extending to an absolute path. Then GDB cannot find source files because of it. The best way to fix this issue is just delete lines with .file directive in .S files and let the compiler to decide what DW_AT_name must contain. Particularly, the compiler fills this filed by an absolute path to a .S file because only absolute paths are used in toolchain's build process. Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
2022-05-18Use global atexit data for all configurationsSebastian Huber1-5/+6
For the exit processing only members of _GLOBAL_REENT were used by default. If the _REENT_GLOBAL_ATEXIT option was enabled, then the data structures were provided through dedicated global objects. Make this option the default. Remove the option. Rename struct _reent members _atexit and _atexit0 to _reserved_6 and _reserved_7, respectively. Provide them only if _REENT_BACKWARD_BINARY_COMPAT is defined.
2017-06-14Add JLI support.Claudiu Zissulescu1-1/+6
Initialize the jli_base registers for ARCv2 cpus. libgloss/ 2017-05-23 Claudiu Zissulescu <claziss@synopsys.com> * arc/crt0.S: Initialize the jli_base registers for ARCv2 cpus.
2017-06-14Add profile support.Claudiu Zissulescu1-0/+14
Add profile support for ARC processors. libgloss/ 2016-07-28 Claudiu Zissulescu <claziss@synopsys.com> * arc/crt0.S: Add calls to profiler support routines. * Makefile.in (CRT0): Add gcrt0. (NSIM_OBJS): Add mcount. (CRT0_INSTALL): Install gcrt0, and crt0. * arc/gcrt0.S: New file. * arc/mcount.c: Likewise.
2016-08-11arc: Add align keyword.Claudiu Zissulescu1-2/+2
libgloss/ 2016-06-28 Claudiu Zissulescu <claziss@synopsys.com> * arc/crt0.S: Add align keyword.
2016-05-25arc: Have nops in _exit_halt only for ARCompactAnton Kolesov1-6/+9
ARCompact processors (ARC 600 and ARC 700) require three "nop"s after the "flag 1" instruction. Later ARC processors do not have this requirement, so it is possible to reduce size of "_exit_halt" for them. libgloss/ 2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S (_exit_halt): Insert nops only for ARCompact.
2016-05-25arc: Rework default exception handlers for ARC EM and HSAnton Kolesov1-73/+34
Initially crt0.S used a special function, declared as weak as a default exception handler in interrupt vector table. To let user override individual handlers, this function had multiple names - one for each IVT entry, which, however, was terribly confusing for the debugger and user - because it wasn't clear which symbol will be used as a function name in debugger. Defining multiple separate functions - one for each handler, would resolve the mess, but would increase code size of crt0.o. To clean this up, this patch defines exception handlers as weak symbols as well, but those are defined as just symbols, not functions, hence there would be less confusion over what is what. At the same time, users still can redefine exception handlers symbol by creating functions with respective names. libgloss/ 2016-05-24 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S: Convert memory_error and friends to non-function symbols.
2016-05-02Fix support ARC processors without barrel-shifterJeff Johnston1-1/+6
crt0.S for ARC used to use instruction "asr.f lp_count, r3, 2" for all cores except ARC601. However instructions which shift more than 1 bit are optional, so this crt0.S didn't worked for all ARC cores. Luckily this is a shift just by 2 bits on all occassions, so fix is trivial - use two single-bit shifts. libgloss/ChangeLog 2016-04-29 Anton Kolesov <anton.kolesov@synopsys.com> * arc/crt0.S: Fix support for processors without barrel-shifter. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
2016-05-02Update crt0.S for ARC.Jeff Johnston1-9/+23
This is similar to commit 06537f05d4b6a0d2db01c6afda1d2a0ea2588126 to the newlib for ARC. GCC for ARC has been updated to provide consistent naming of preprocessor definitions for different optional architecture features: * __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for -mbarrel-shifter * __ARCEM__ instead of __EM__ for ARC EM cores * __ARCHS__ instead of __HS__ for ARC HS cores * etc (not used in libgloss) This patch updates crt0.S for ARC to use new definitions instead of a deprecated ones. To ensure compatibility with older compiler new definitions are also defined in crt0.S if needed, based on presence of deprecated preprocessor definitions. libgloss/ChangeLog 2016-04-29 Anton Kolesov <Anton.Kolesov@synopsys.com> * arc/crt0.S: Use new GCC defines to detect processor features.
2015-11-12Add support for ARC to libglossAnton Kolesov1-0/+241
ChangeLog: 2015-11-12 Anton Kolesov <Anton.Kolesov@synopsys.com> * configure.in: Add ARC support to libgloss. * configure: Regenerate. libgloss/ChangeLog: 2015-11-12 Anton Kolesov <Anton.Kolesov@synopsys.com> * configure: Add ARC support. * configure.in: Likewise. * arc/Makefile.in: Likewise. * arc/aclocal.m4: Likewise. * arc/configure: Likewise. * arc/configure.in: Likewise. * arc/crt0.S: Likewise. * arc/libcfunc.c: Likewise. * arc/nsim-syscall.h: Likewise. * arc/nsim-syscalls.c: Likewise. * arc/nsim.specs: Likewise. * arc/sbrk.c: Likewise.