summaryrefslogtreecommitdiff
path: root/ldso
AgeCommit message (Collapse)Author
2016-05-28ldso: Force disable -mlong-calls when compiling ldso for ARCAlexey Brodkin
Even though by default for ARC uClibc gets compiled with disabled long-calls user may provide UCLIBC_EXTRA_CFLAGS with "-mlong-calls". With this option uClibc will be successfully compiled but later it will fail in runtime because dynamic loader cannot deal with relocations at least very early on its start. In particular it will be seen as call to non-relocated symbol _dl_parse_dynamic_info() which ends-up as a segfault like this: ------------------------>8-------------------- potentially unexpected fatal signal 11. Path: /bin/test CPU: 0 PID: 63 Comm: test Not tainted 4.5.2 #7 task: 9f13f180 ti: 9f166000 task.ti: 9f166000 [ECR ]: 0x00040000 => Insn could not be fetched [EFA ]: 0x0000283c [BLINK ]: 0x2000407c [ERET ]: 0x283c @No matching VMA found [STAT32]: 0x8008009e : IE U BTA: 0x0000283c SP: 0x5fef5ccc FP: 0x00000000 LPS: 0x20004080 LPE: 0x20004064 LPC: 0x00000000 r00: 0x20006684 r01: 0x5fef5db0 r02: 0x00000000 r03: 0x20000000 r04: 0x80808080 r05: 0x2f2f2f2f r06: 0x41464d00 r07: 0x00000080 r08: 0x000000dd r09: 0x00000000 r10: 0x00000073 r11: 0x80808080 r12: 0x2000407c r13: 0x20000000 r14: 0x5fef5e74 r15: 0x000ceb3c r16: 0x5fef5e7c r17: 0x5fef5d44 r18: 0x000ceb0c r19: 0xffffffff r20: 0x000ceb1c r21: 0x00000000 r22: 0x00000000 r23: 0x000d08a5 r24: 0x00000000 r25: 0x80808080 Segmentation fault ------------------------>8-------------------- Solution to this issue is simple we make sure dynamic loader never gets compiled with "-mlong-calls" by forcing "-mno-long-calls" on it. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Anton Kolesov <akolesov@synopsys.com> Cc: linux-snps-arc@lists.infradead.org
2016-05-28ldso/ARC: fix DT_RELACOUNT handlingCupertino Miranda
With new binutils supporting DT_RELACOUNT, ldso was crashing as it was parsing relocs incorrectly. Apparently that code ran for first time and was never tested. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2016-05-24microblaze: fix ELF detection in ld.soWaldemar Brodkorb
2016-04-15replace FSF addresses with URLsNikola Forró
License notices in most of the source files refer to an outdated FSF address. Replace it with URL, like in the rest of the source files.Signed-off-by: Nikola Forró <nforro@redhat.com>
2016-02-21arm: allow to build with DODEBUG=yWaldemar Brodkorb
Avoids following linking error: /usr/lib/gcc/arm-openadk-linux-uclibceabihf/5.3.0/libgcc.a(unwind-arm.o): In function `unwind_phase2': ../w-gcc-5.3.0-1/gcc-5.3.0/libgcc/unwind-arm-common.inc:289: undefined reference to `abort' /usr/lib/gcc/arm-openadk-linux-uclibceabihf/5.3.0/libgcc.a(unwind-arm.o): In function `unwind_phase2_forced': ../w-gcc-5.3.0-1/gcc-5.3.0/libgcc/unwind-arm-common.inc:346: undefined reference to `memcpy' collect2: error: ld returned 1 exit status
2016-02-21mips64: with n64 ABI mapping failedWaldemar Brodkorb
Booting on Lemote Yeelong with a page size != 4kb ld.so is crashing and failed to load libc.so. Do not hardcode the offset for n64 ABI.
2016-02-07frv: resurrect port somehow, totally untestedWaldemar Brodkorb
The FR-V port is really broken, and I have no emulator or hardware for this platform. I tried to get some hardware from RedHat, who made the FR-V port initially. Unfortunately Fujitsi didn't agreed to sent me some of their unused spare hardware lying @RedHat. As I invested some time to get stuff compiled, I decided to add the code and may be anytime later I can gain access to some emulator or hardware. GDB simulator for FR-V doesn't support booting Linux AFAIK.
2016-01-31ldso: Use single rtld_flags interpretation through all the callsLeonid Lisovskiy
Implement single rtld_flags interpretation through all the do_dlopen()/_dl_load_shared_library()/_dl_load_elf_shared_library() calls chain. This adds the ability to use the flags, passed to dlopen(), in all underlaying functions and implement rtld_flags inheritance. Saves a few bytes code. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-31ldso: Fix fail of $ORIGIN expansion in case of RTLD_NOLOADLeonid Lisovskiy
$ORIGIN expansion in search_for_named_library() wrongly takes into account all bits of rflags. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-31libdl: dlopen() mustn't forget RTLD_NODELETE flagLeonid Lisovskiy
If RTLD_NODELETE is passed to dlopen() rather than set on shared library itself, flag propagation to rtld_flags is missed. Test-case taken from glibc. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2015-12-23Replace bltzal with lapc for MIPS R6 builds.Steve Ellcey
The R6 version of MIPS does not support the bltzal instruction. This patch changes dl-startup.h and dl-sysdep.h to use lapc on R6 instead. lapc is a new R6 insruction so older systems need to continue to use bltzal in order to load register $31. Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
2015-12-17dlclose fixWaldemar Brodkorb
Patch is from Timo Teras Refs.: http://lists.uclibc.org/pipermail/uclibc/2012-October/047059.html http://git.alpinelinux.org/cgit/aports/tree/main/libc0.9.32/uclibc-dlclose-fix.patch
2015-12-05remove sh64 supportWaldemar Brodkorb
No real hardware available. The project for sh64 with sh5 seems dead since 10 years. Gcc will remove support for it soon.
2015-11-23xtensa: remove ldso workaround by real pointer checkWaldemar Brodkorb
An abort() is only generated when gcc does not implement a trap handler for the target architecture. This fixes the abort() generation. Latest gcc git master also contains a trap handler for xtensa. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Walemar Brodkorb <wbx@uclibc-ng.org>
2015-10-22ARC: With NPTL support, GP is no longer used for PICVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2015-10-16ia64: enable and fix compile issuesWaldemar Brodkorb
Enable ia64 in the menu. Fix build for architectures withou ld.so support. Fix syntax error in bits/byteswap.h.
2015-10-09add new architecture support for or1kWaldemar Brodkorb
Information about Openrisc: http://opencores.org/or1k/Main_Page Integrated from: https://github.com/openrisc/uClibc-or1k
2015-10-08xtensa: support call0 ABIMax Filippov
Most changes are mechanical replacement of 'retw' instruction with 'abi_ret' macro, defined to 'retw' or 'ret' according to ABI. Assembly code that makes calls is duplicated for call0 ABI with changed register numbers for parameters/return value and call instruction. 'entry' instructions are replaced with 'abi_entry' macro. More interesting changes: - non-leaf assembly functions (e.g. _dl_tlsdesc_dynamic, _dl_linux_resolve, SYSCALL_ERROR_HANDLER, PSEUDO) now need to preserve registers around intermediate calls they make, use temporary stack frame for that; - setjmp/longjmp only need to save and restore return address, stack pointer and callee-saved registers in the jmpbuf; - __clone and syscall functions had hardcoded offsets to parameter passed on stack, on call0 ABI they don't need stack frame, so the offset is different. Replace these offsets with FRAMESIZE macro. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-08-22ldso: install backward compatibility symlink by defaultWaldemar Brodkorb
Simplify the switch from uClibc to uClibc-ng suggested by Alexey Brodkin <Alexey.Brodkin@synopsys.com>. Gcc always uses .0 ld.so link, so install it by default.
2015-08-19Revert "ldso: install backward compatibility symlink by default"Waldemar Brodkorb
This reverts commit f52fb21a7af0aa4e983b3e6c2ddd1b6a526b5169. Totally wrong patch.
2015-08-15ldso: install backward compatibility symlink by defaultWaldemar Brodkorb
Simplify the switch from uClibc to uClibc-ng suggested by Alexey Brodkin <Alexey.Brodkin@synopsys.com>. Gcc always uses .0 ld.so link, so install it by default.
2015-08-02simplify, as the other does not work correctly, suggested by tgWaldemar Brodkorb
2015-07-11builtin_unreachable is not available for older gccWaldemar Brodkorb
2015-06-23add patch from ldso-future branchWaldemar Brodkorb
Fixes segfaults when gcc 5.1 is used for x86. http://git.uclibc.org/uClibc/commit/ldso/ldso/i386/dl-sysdep.h?h=ldso-future&id=7de778389d0040be4a21ffc326310e0eb361570a Mentioned in #uclibc.
2015-06-10avoid some compiler warningsWaldemar Brodkorb
Patch seen here: http://lists.uclibc.org/pipermail/uclibc/2015-April/048892.html
2015-06-10h8300: Add new featureYoshinori Sato
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-24merge uClibc changesWaldemar Brodkorb
2015-04-22arm: Add BX and BXC macrosBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22NPTL: Rename a variableBernhard Reutner-Fischer
There seems to be a bug in gold with static TLS at least on x86_64 (?) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22ldso: PRELINK: Remove surplus newlineBernhard Reutner-Fischer
in early debugging code Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-15merge uClibc masterWaldemar Brodkorb
2015-04-14prelink: handle _begin in a gold-agnostic wayBernhard Reutner-Fischer
The nostartfiles is redundant but better be safe Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-13Merge branch '1.0' of git+ssh://uclibc-ng.org/git/uclibc-ng into 1.0Waldemar Brodkorb
2015-04-13fix compile error when LDSO_RUNPATH_OF_EXECUTABLE is setWaldemar Brodkorb
2015-04-13still required for xtensaWaldemar Brodkorb
2015-04-13gcc 4.4 does not have __builtin_unreachableWaldemar Brodkorb
For avr32 we still use gcc 4.4 compiler, so exlude the usage of __builtin_unreachable here.
2015-04-13Revert "gcc 4.9.x produces some calls to abort()"Waldemar Brodkorb
This reverts commit 69ba9dcaa13bb8bbdc8630265d73298c39945416.
2015-04-13buildsys: Do not build crt upon pregenBernhard Reutner-Fischer
No need to build crt when just generating headers Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31buildsys: Do not build crt upon pregenBernhard Reutner-Fischer
No need to build crt when just generating headers Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-29merge uClibc git masterWaldemar Brodkorb
2015-03-27Add support for R_ARC_NONE relocations.Andrew Burgess
The R_ARC_NONE relocation is generated when --gc-sections, used by the compile time linker, removes some sections. This is completely normal, and we can see that all other targets (based on random sampling) have support for R_*_NONE relocations (named for each target). Handling R_ARC_NONE involves doing nothing with it, which is nice and easy. Signed-off-by: Andrew Burgess <andrew.burgess@embecosm.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-26ldso: mark _dl_exit as noreturnBernhard Reutner-Fischer
Otherwise gcc might not understand that oom() ended control-flow and might emit an (untaken) reference to abort() in _dl_update_slotinfo() on e.g. SH4 which breaks linking ld-uClibc.so. Arguably -ffreestanding should prevent GCC from emitting this '.global abort' but alas, it does not, which is another bug.. Also mark the function cold to further lower the incoming frequency and branch probability. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-24libm: honor NO_LONG_DOUBLE in ldouble_wrappersBernhard Reutner-Fischer
Fixes SH build breakage due to attempts to define hidden defs for unavailable long double functions. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-22fix bfin compile, -msoft-float is not availableWaldemar Brodkorb
2015-03-08okay, chicken-egg-problem solved really now. (was xtensa no thread failure)Waldemar Brodkorb
2015-03-07should have test it better, fix non-thread compileWaldemar Brodkorb
2015-03-07fix non-thread compile for xtensaWaldemar Brodkorb
2015-03-04Merge remote-tracking branch 'origin/upstream' into 1.0Waldemar Brodkorb
2015-02-27ldso: silence warningBernhard Reutner-Fischer
In file included from ldso/ldso/ldso.c:87:0: ldso/ldso/dl-startup.c: In function '_dl_start': ldso/ldso/dl-startup.c:184:32: warning: cast from pointer to integer of differennt size [-Wpointer-to-int-cast] auxvt[AT_BASE].a_un.a_val = (Elf32_Addr) &_begin; Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-20gcc 4.9.x produces some calls to abort()Waldemar Brodkorb
For sh4/xtensa architectures there is an optimization bug, which does not allow to compile ld.so with gcc 4.9.2. Disable this optimization for sh4/xtensa and ld.so compile.