summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/crt1.S
AgeCommit message (Collapse)Author
2023-12-12elf: support ELF binaries in noMMUGreg Ungerer
The Linux kernels ELF-FDPIC binfmt program loader can support loading and running conventional ELF format binaries on noMMU kernels when compiled appropriately. That is when they are constant displacement binaries such as generated using the -pie compile option. Add a configure option to allow selecting ELF binary support in noMMU mode configurations on architectures that support this. The main requirement is to generate the ldso run-time loader to perform relocation at load time. These configurations do not support shared libraries, so there is no need to generate a full shared library, only the static version is required. The use of ELF format binaries does mean a slightly simpler toolchain generation (does not require a -uclinux- for some architectures) and does not require an extra tool like elf2flt. This initial support targets M68K, ARM and RISC-V architectures. No kernel changes are required, the required support for this is already in mainline kernels (certainly as of linux-6.6). Note that for the M68K and ARM architectures that the initialized registers and stack layout at process startup is slightly different for the flat format loader and the ELF/ELF-FDPIC loaders. So we need some changes to the startup code (crt1.S) for them. I have not done extensive testing outside of M68K, ARM and RISC-V. I had to make changes to a couple of the dl-startup.h architecture files to get them to build for this noMMU case. I did not dig down too deep on the reasons, but they still seem ok for the MMU case as well. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
2022-07-26Added support for creation of Static Position-Independent Executables (PIE) ↵linted
on i386, x86_64, and arm. This patch adds the generation of rcrt1.o which is used by gcc when compiling with the --static-pie flag. rcrt1.o differs from crt1.o and Scrt1.o in that it the executable has a dynamic section but no relocations have been performed prior to _start being called. crt1.o assumes there to be no dynamic relocations, and Scrt1.o has all relocations performed prior to execution by lsdo. The new reloc_static_pie function handles parsing the dynamic section, and performing the relocations in a architecture agnostic method. It also sets _dl_load_base which is used when initalizing TLS to ensure loading from the proper location. This allows for easier porting of static-pie support to additional architectures as only modifications to crt1.S to find the load address are required. Signed-off-by: linted <linted@users.noreply.github.com>
2018-11-01Add support for Thumb-only processors.Christophe Lyon
* ldso/ldso/arm/aeabi_read_tp.S: Add Thumb version. * ldso/ldso/arm/dl-startup.h: Do not force ARM encoding, adjust for Thumb. * ldso/ldso/arm/resolve.S: Force Thumb encoding on Thumb-only processors. * libc/sysdeps/linux/arm/crt1.S: Do not force ARM encoding, adjust for Thumb. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10Add application startup code for FDPICChristophe Lyon
* libc/sysdeps/linux/arm/crt1.S: Define _start for __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-21arm/crt1.S: Avoid dependency on PC+4 or PC+8Khem Raj
* fix a problem with Thumb PIE binaries, where the GOT was located incorrectly because of an offset 8 Signed-off-by: Khem Raj <raj.khem@gmail.com>
2008-11-25- Fix thumb2 PIE (Joseph S. Myers)Bernhard Reutner-Fischer
This patch fixes position-independent executables (PIEs) for Thumb-2. In Thumb assembly, instructions reading pc give a value 4 greater than the address of the instruction, rather than 8 greater as in ARM mode, so the offset to the GOT needs to have the right offset. (The Thumb-1 code already gets this right; it's the code shared by ARM and Thumb-2 that needs fixing.)
2008-03-26Paul Brook writes:Bernhard Reutner-Fischer
The attached patch adds support for compiling arm uClibc as pure Thumb code. This is needed because some recent ARM codes do not implement traditional ARM mode. Specifically: * Cortex-M1 - An extremely minimal FPGA based core that only implements Thumb-1 (aka ARMv6-M). * Cortex-M3 - A Thumb-2 only ARMv7-M core. Most of uClibc already builds in Thumb mode, all that is left are a handful of assembly bits. Tested on arm-uclinuxeabi.
2007-01-28Paul Brook writes:Mike Frysinger
The patch below tweaks the ARM nommu startup code so that doubleword stack alignment is preserved. This is required on EABI targets.
2006-02-18tweak the idea between having a MMU and actually using itMike Frysinger
2006-01-14fix loading of argc/argv for arm/nommuMike Frysinger
2005-11-10sync with glibcMike Frysinger
2005-10-05merge additional license cruft from glibcMike Frysinger
2005-09-29Add .type _init/_fini unconditionally to arm/crt1.SPeter S. Mazinger
2005-09-28arm/crt1.S needs features.h and the weak _init/_fini independently of ↵Peter S. Mazinger
__PIC__. Add these weaks to mips/crt1.S as well.
2005-09-18declare _init/_fini weak if UCLIBC_CTOR_DTOR is not definedMike Frysinger
2005-06-26Oops.Joakim Tjernlund
2005-06-25Change L_Scrt1 to __PIC__Joakim Tjernlund
2005-06-25Hopefully fix PIE apps.Joakim Tjernlund
2005-06-10Based on start.S from debian's glibc, this gets arm workingEric Andersen
properly with the new ABI
2005-06-10oops. I'd left some junk in thereEric Andersen
2005-06-10rework arm crt1 properly this time aroundEric Andersen
2005-06-10Dunno yet if I got this right or not, but it now at leastEric Andersen
has a chance of perhaps working...