From 730db44f0824f505a31822e250b9f04b9f8e7a1b Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 24 Mar 2015 00:11:47 +0100 Subject: libm: honor NO_LONG_DOUBLE in ldouble_wrappers Fixes SH build breakage due to attempts to define hidden defs for unavailable long double functions. Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/sh/dl-syscalls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ldso') diff --git a/ldso/ldso/sh/dl-syscalls.h b/ldso/ldso/sh/dl-syscalls.h index f9f13c7fa..b99a9b5a0 100644 --- a/ldso/ldso/sh/dl-syscalls.h +++ b/ldso/ldso/sh/dl-syscalls.h @@ -1,4 +1,4 @@ -#if __GNUC_PREREQ (4, 1) +#if __GNUC_PREREQ (4, 1) && !__GNUC_PREREQ (4, 9) #warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline # ifdef __always_inline # undef __always_inline -- cgit v1.2.3 From 2c8a7766681b704e710f51c0817534e3f9a952d1 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 26 Mar 2015 00:02:58 +0100 Subject: ldso: mark _dl_exit as noreturn 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 --- ldso/include/dl-syscall.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ldso') diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index 675b93ae8..e556f7b56 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -52,7 +52,15 @@ extern int _dl_errno; dynamic linking at all, so we cannot return any error codes. We just punt if there is an error. */ #define __NR__dl_exit __NR_exit -static __always_inline _syscall1(void, _dl_exit, int, status) +static __always_inline attribute_noreturn __cold void _dl_exit(int status) +{ + INLINE_SYSCALL(_dl_exit, 1, status); +#if defined __GNUC__ + __builtin_unreachable(); /* shut up warning: 'noreturn' function does return*/ +#else + while (1); +#endif +} #define __NR__dl_close __NR_close static __always_inline _syscall1(int, _dl_close, int, fd) -- cgit v1.2.3 From 8fde02feb2f8a36934308012d89fa6614967b2dc Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 26 Mar 2015 14:25:34 +0530 Subject: Add support for R_ARC_NONE relocations. 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 Signed-off-by: Vineet Gupta Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/arc/elfinterp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ldso') diff --git a/ldso/ldso/arc/elfinterp.c b/ldso/ldso/arc/elfinterp.c index 7c31d3ac7..2f0cf7f66 100644 --- a/ldso/ldso/arc/elfinterp.c +++ b/ldso/ldso/arc/elfinterp.c @@ -144,6 +144,8 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, #endif switch (reloc_type) { + case R_ARC_NONE: + break; case R_ARC_32: *reloc_addr += symbol_addr + rpnt->r_addend; break; @@ -202,6 +204,8 @@ _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, #endif switch (reloc_type) { + case R_ARC_NONE: + break; case R_ARC_JMP_SLOT: *reloc_addr += tpnt->loadaddr; break; -- cgit v1.2.3