This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via 7d303841dbb6e668e5acdd9218ce82231a00a967 (commit)
from f347524fade67b41fb8e46283a6f0ae4aa19e6b0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7d303841dbb6e668e5acdd9218ce82231a00a967
Author: Vineet Gupta <Vineet.Gupta1(a)synopsys.com>
Date: Tue Jun 30 17:46:56 2015 +0530
NPTL/arc: notify kernel of the TP value
Native gdb makes a ptrace (GET_THREAD_AREA) which needs to return the
TP. however when libc sets up TP reg (for main thread), it doesn't call
arc_settls syscall so kernel doesn't know of TP register details
(moreso because clone doesnt have SETTLS flag)
Note that kernel doesn't know about r25 being TP etc.
This commit got lost in merge of NPTL tools into arc-mainline-dev and
showed up again as STAR 9000919529 (native gdb can't debug threaded
apps)
------->8---------------
[ARCLinux]# gdb ./pth
Reading symbols from ./pth...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x106f2
(gdb) r
Starting program: /pth
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
thread_get_info_callback: cannot get thread info: generic error
(gdb) q
------->8---------------
Debugged-by: Anton Kolesov <akolesov(a)synopsys.com>
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
-----------------------------------------------------------------------
Summary of changes:
libpthread/nptl/sysdeps/arc/tls.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libpthread/nptl/sysdeps/arc/tls.h b/libpthread/nptl/sysdeps/arc/tls.h
index 63dd113..4af415a 100644
--- a/libpthread/nptl/sysdeps/arc/tls.h
+++ b/libpthread/nptl/sysdeps/arc/tls.h
@@ -104,8 +104,11 @@ typedef struct
operation can cause a failure 'errno' must not be touched. */
# define TLS_INIT_TP(tcbp, secondcall) \
({ \
- __builtin_set_thread_pointer(tcbp); \
- NULL; \
+ long result_var; \
+ __builtin_set_thread_pointer(tcbp); \
+ result_var = INTERNAL_SYSCALL (arc_settls, err, 1, (tcbp)); \
+ INTERNAL_SYSCALL_ERROR_P (result_var, err) \
+ ? "unknown error" : NULL; \
})
/* Return the address of the dtv for the current thread.
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 6da5676cbe02149ef64197927b8b2fbec6055fc9 (commit)
from 5d793a8cfcf60e8e0bda3e6e2c1ab7a9aa30c558 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6da5676cbe02149ef64197927b8b2fbec6055fc9
Author: Vineet Gupta <Vineet.Gupta1(a)synopsys.com>
Date: Tue Jun 30 17:46:56 2015 +0530
NPTL/arc: notify kernel of the TP value
Native gdb makes a ptrace (GET_THREAD_AREA) which needs to return the
TP. however when libc sets up TP reg (for main thread), it doesn't call
arc_settls syscall so kernel doesn't know of TP register details
(moreso because clone doesnt have SETTLS flag)
Note that kernel doesn't know about r25 being TP etc.
This commit got lost in merge of NPTL tools into arc-mainline-dev and
showed up again as STAR 9000919529 (native gdb can't debug threaded
apps)
------->8---------------
[ARCLinux]# gdb ./pth
Reading symbols from ./pth...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x106f2
(gdb) r
Starting program: /pth
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
thread_get_info_callback: cannot get thread info: generic error
(gdb) q
------->8---------------
Debugged-by: Anton Kolesov <akolesov(a)synopsys.com>
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
-----------------------------------------------------------------------
Summary of changes:
libpthread/nptl/sysdeps/arc/tls.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libpthread/nptl/sysdeps/arc/tls.h b/libpthread/nptl/sysdeps/arc/tls.h
index 63dd113..4af415a 100644
--- a/libpthread/nptl/sysdeps/arc/tls.h
+++ b/libpthread/nptl/sysdeps/arc/tls.h
@@ -104,8 +104,11 @@ typedef struct
operation can cause a failure 'errno' must not be touched. */
# define TLS_INIT_TP(tcbp, secondcall) \
({ \
- __builtin_set_thread_pointer(tcbp); \
- NULL; \
+ long result_var; \
+ __builtin_set_thread_pointer(tcbp); \
+ result_var = INTERNAL_SYSCALL (arc_settls, err, 1, (tcbp)); \
+ INTERNAL_SYSCALL_ERROR_P (result_var, err) \
+ ? "unknown error" : NULL; \
})
/* Return the address of the dtv for the current thread.
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 5d793a8cfcf60e8e0bda3e6e2c1ab7a9aa30c558 (commit)
from 42d180da69fd31f3a8af91c9470da6abdf91574a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5d793a8cfcf60e8e0bda3e6e2c1ab7a9aa30c558
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Wed Jun 10 10:17:11 2015 -0500
use common ptrace.h for xtensa, fixes buildroot issues compiling enlightment
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/xtensa/sys/ptrace.h | 155 --------------------------------
1 file changed, 155 deletions(-)
delete mode 100644 libc/sysdeps/linux/xtensa/sys/ptrace.h
diff --git a/libc/sysdeps/linux/xtensa/sys/ptrace.h b/libc/sysdeps/linux/xtensa/sys/ptrace.h
deleted file mode 100644
index 882b8c8..0000000
--- a/libc/sysdeps/linux/xtensa/sys/ptrace.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* `ptrace' debugger support interface. Linux version.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_PTRACE_H
-#define _SYS_PTRACE_H 1
-
-#include <features.h>
-
-/* Kludge away careless namespace pollution from the kernel. */
-
-#undef PTRACE_GETREGS
-#undef PTRACE_SETREGS
-#undef PTRACE_GETFPREGS
-#undef PTRACE_SETFPREGS
-#undef PTRACE_GETFPREGSIZE
-
-
-__BEGIN_DECLS
-
-/* Type of the REQUEST argument to `ptrace.' */
-enum __ptrace_request
-{
- /* Indicate that the process making this request should be traced.
- All signals received by this process can be intercepted by its
- parent, and its parent can use the other `ptrace' requests. */
- PTRACE_TRACEME = 0,
-#define PT_TRACE_ME PTRACE_TRACEME
-
- /* Return the word in the process's text space at address ADDR. */
- PTRACE_PEEKTEXT = 1,
-#define PT_READ_I PTRACE_PEEKTEXT
-
- /* Return the word in the process's data space at address ADDR. */
- PTRACE_PEEKDATA = 2,
-#define PT_READ_D PTRACE_PEEKDATA
-
- /* Return the word in the process's user area at offset ADDR. */
- PTRACE_PEEKUSER = 3,
-#define PT_READ_U PTRACE_PEEKUSER
-
- /* Write the word DATA into the process's text space at address ADDR. */
- PTRACE_POKETEXT = 4,
-#define PT_WRITE_I PTRACE_POKETEXT
-
- /* Write the word DATA into the process's data space at address ADDR. */
- PTRACE_POKEDATA = 5,
-#define PT_WRITE_D PTRACE_POKEDATA
-
- /* Write the word DATA into the process's user area at offset ADDR. */
- PTRACE_POKEUSER = 6,
-#define PT_WRITE_U PTRACE_POKEUSER
-
- /* Continue the process. */
- PTRACE_CONT = 7,
-#define PT_CONTINUE PTRACE_CONT
-
- /* Kill the process. */
- PTRACE_KILL = 8,
-#define PT_KILL PTRACE_KILL
-
- /* Single step the process.
- This is not supported on all machines. */
- PTRACE_SINGLESTEP = 9,
-#define PT_STEP PTRACE_SINGLESTEP
-
- /* Get all general purpose registers used by a processes.
- This is not supported on all machines. */
- PTRACE_GETREGS = 12,
-#define PT_GETREGS PTRACE_GETREGS
-
- /* Set all general purpose registers used by a processes.
- This is not supported on all machines. */
- PTRACE_SETREGS = 13,
-#define PT_SETREGS PTRACE_SETREGS
-
- /* Get all floating point registers used by a processes.
- This is not supported on all machines. */
- PTRACE_GETFPREGS = 14,
-#define PT_GETFPREGS PTRACE_GETFPREGS
-
- /* Set all floating point registers used by a processes.
- This is not supported on all machines. */
- PTRACE_SETFPREGS = 15,
-#define PT_SETFPREGS PTRACE_SETFPREGS
-
- /* Attach to a process that is already running. */
- PTRACE_ATTACH = 16,
-#define PT_ATTACH PTRACE_ATTACH
-
- /* Detach from a process attached to with PTRACE_ATTACH. */
- PTRACE_DETACH = 17,
-#define PT_DETACH PTRACE_DETACH
-
- /* Get size required for the buffer holding the floating point registers.
- This is not supported on all machines. */
- PTRACE_GETFPREGSIZE = 18,
-#define PT_GETFPREGSIZE PTRACE_GETFPREGSIZE
-
- /* Continue and stop at the next (return from) syscall. */
- PTRACE_SYSCALL = 24
-#define PT_SYSCALL PTRACE_SYSCALL
-};
-
-/* Options set using PTRACE_SETOPTIONS. */
-enum __ptrace_setoptions {
- PTRACE_O_TRACESYSGOOD = 0x00000001,
- PTRACE_O_TRACEFORK = 0x00000002,
- PTRACE_O_TRACEVFORK = 0x00000004,
- PTRACE_O_TRACECLONE = 0x00000008,
- PTRACE_O_TRACEEXEC = 0x00000010,
- PTRACE_O_TRACEVFORKDONE = 0x00000020,
- PTRACE_O_TRACEEXIT = 0x00000040,
- PTRACE_O_MASK = 0x0000007f
-};
-
-/* Wait extended result codes for the above trace options. */
-enum __ptrace_eventcodes {
- PTRACE_EVENT_FORK = 1,
- PTRACE_EVENT_VFORK = 2,
- PTRACE_EVENT_CLONE = 3,
- PTRACE_EVENT_EXEC = 4,
- PTRACE_EVENT_VFORK_DONE = 5,
- PTRACE_EVENT_EXIT = 6
-};
-
-/* Perform process tracing functions. REQUEST is one of the values
- above, and determines the action to be taken.
- For all requests except PTRACE_TRACEME, PID specifies the process to be
- traced.
-
- PID and the other arguments described above for the various requests should
- appear (those that are used for the particular request) as:
- pid_t PID, void *ADDR, int DATA, void *ADDR2
- after REQUEST. */
-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
-
-__END_DECLS
-
-#endif /* _SYS_PTRACE_H */
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Hi Waldemar,
these two patches fix tst-mqueue* tests that are currently failing on xtensa.
Max Filippov (2):
xtensa: add ret_ERRVAL definition
xtensa: fix stack frame size for NPTL
libc/sysdeps/linux/xtensa/sysdep.h | 5 +++++
libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h | 10 +++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
--
1.8.1.4
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via f347524fade67b41fb8e46283a6f0ae4aa19e6b0 (commit)
via f3a8267dabab20b095abe36e4a2be14ccc34b38e (commit)
from d551a039ad443e1ba1c29461b43ca865785fbb68 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f347524fade67b41fb8e46283a6f0ae4aa19e6b0
Author: Max Filippov <jcmvbkbc(a)gmail.com>
Date: Mon Jun 22 04:10:54 2015 +0300
xtensa: add ret_ERRVAL definition
ret_ERRVAL is used by mq_timedsend and mq_timedreceive, it needs to be
defined to retw, otherwise error return from those functions segfaults.
This fixes the following testsuite failures:
.... tst-mqueue1
FAIL tst-mqueue1 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue2
FAIL tst-mqueue2 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue3
FAIL tst-mqueue3 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue4
FAIL tst-mqueue4 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue5
FAIL tst-mqueue5 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue6
FAIL tst-mqueue6 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
commit f3a8267dabab20b095abe36e4a2be14ccc34b38e
Author: Max Filippov <jcmvbkbc(a)gmail.com>
Date: Mon Jun 22 04:10:55 2015 +0300
xtensa: fix stack frame size for NPTL
Cancellable syscalls use call8 to call functions that enable/disable
cancellation, thus they cannot use the default FRAMESIZE.
Redefine FRAMESIZE for such syscalls.
This fixes the following testsuite failure:
.... tst-mqueue8
FAIL tst-mqueue8 got 1 expected 0
going to cancel mq_receive in-time
in-time mq_receive cancellation succeeded
going to cancel mq_receive early
Didn't expect signal from child: got `Segmentation fault'
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/xtensa/sysdep.h | 5 +++++
.../nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h | 10 +++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h
index cab4a2f..4873a41 100644
--- a/libc/sysdeps/linux/xtensa/sysdep.h
+++ b/libc/sysdeps/linux/xtensa/sysdep.h
@@ -72,7 +72,9 @@
#define JUMPTARGET(name) name
#endif
+#ifndef FRAMESIZE
#define FRAMESIZE 16
+#endif
#define CALL_MCOUNT /* Do nothing. */
@@ -130,6 +132,9 @@
#define PSEUDO_END_ERRVAL(name) \
END (name)
+#undef ret_ERRVAL
+#define ret_ERRVAL retw
+
#if defined _LIBC_REENTRANT
# if defined USE___THREAD
# ifndef NOT_IN_libc
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h
index 6bb2aeb..f82957d 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h
@@ -24,7 +24,15 @@
#endif
#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
-// FIXME: ENTRY includes an entry instruction, here we'd want entry sp, 48!
+
+/* CENABLE/CDISABLE in PSEUDO below use call8, stack frame size must be
+ * at least 32.
+ */
+#if FRAMESIZE < 32
+#undef FRAMESIZE
+#define FRAMESIZE 32
+#endif
+
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.text; \
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 8869e46f53d66c447fd32086da6c508c03bd1b19 (commit)
via 2f478a5d069044cead320c04a2ad9998a2651551 (commit)
from 1d81dc5276b78a6f893c35ffd80bbf331d4f0833 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8869e46f53d66c447fd32086da6c508c03bd1b19
Author: Max Filippov <jcmvbkbc(a)gmail.com>
Date: Mon Jun 22 04:10:55 2015 +0300
xtensa: fix stack frame size for NPTL
Cancellable syscalls use call8 to call functions that enable/disable
cancellation, thus they cannot use the default FRAMESIZE.
Redefine FRAMESIZE for such syscalls.
This fixes the following testsuite failure:
.... tst-mqueue8
FAIL tst-mqueue8 got 1 expected 0
going to cancel mq_receive in-time
in-time mq_receive cancellation succeeded
going to cancel mq_receive early
Didn't expect signal from child: got `Segmentation fault'
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
commit 2f478a5d069044cead320c04a2ad9998a2651551
Author: Max Filippov <jcmvbkbc(a)gmail.com>
Date: Mon Jun 22 04:10:54 2015 +0300
xtensa: add ret_ERRVAL definition
ret_ERRVAL is used by mq_timedsend and mq_timedreceive, it needs to be
defined to retw, otherwise error return from those functions segfaults.
This fixes the following testsuite failures:
.... tst-mqueue1
FAIL tst-mqueue1 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue2
FAIL tst-mqueue2 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue3
FAIL tst-mqueue3 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue4
FAIL tst-mqueue4 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue5
FAIL tst-mqueue5 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
.... tst-mqueue6
FAIL tst-mqueue6 got 1 expected 0
Didn't expect signal from child: got `Segmentation fault'
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/xtensa/sysdep.h | 5 +++++
.../nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h | 10 +++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h
index cab4a2f..4873a41 100644
--- a/libc/sysdeps/linux/xtensa/sysdep.h
+++ b/libc/sysdeps/linux/xtensa/sysdep.h
@@ -72,7 +72,9 @@
#define JUMPTARGET(name) name
#endif
+#ifndef FRAMESIZE
#define FRAMESIZE 16
+#endif
#define CALL_MCOUNT /* Do nothing. */
@@ -130,6 +132,9 @@
#define PSEUDO_END_ERRVAL(name) \
END (name)
+#undef ret_ERRVAL
+#define ret_ERRVAL retw
+
#if defined _LIBC_REENTRANT
# if defined USE___THREAD
# ifndef NOT_IN_libc
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h
index 6bb2aeb..f82957d 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/xtensa/sysdep-cancel.h
@@ -24,7 +24,15 @@
#endif
#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
-// FIXME: ENTRY includes an entry instruction, here we'd want entry sp, 48!
+
+/* CENABLE/CDISABLE in PSEUDO below use call8, stack frame size must be
+ * at least 32.
+ */
+#if FRAMESIZE < 32
+#undef FRAMESIZE
+#define FRAMESIZE 32
+#endif
+
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.text; \
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via d551a039ad443e1ba1c29461b43ca865785fbb68 (commit)
from afad51b5f4b0093937304ca99fb8b679ab47eb56 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d551a039ad443e1ba1c29461b43ca865785fbb68
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Tue Jun 23 21:18:49 2015 +0200
add patch from ldso-future branch
Fixes segfaults when gcc 5.1 is used for x86.
http://git.uclibc.org/uClibc/commit/ldso/ldso/i386/dl-sysdep.h?h=ldso-futur…
Mentioned in #uclibc.
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/i386/dl-sysdep.h | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index a66c802..8efa1a8 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -37,31 +37,27 @@ extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_ent
| (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
-static __always_inline Elf32_Addr elf_machine_dynamic (void) attribute_unused;
-static __always_inline Elf32_Addr
+ first element of the GOT, a special entry that is never relocated. */
+extern const Elf32_Addr _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
+static __always_inline Elf32_Addr __attribute__ ((unused, const))
elf_machine_dynamic (void)
{
- register Elf32_Addr *got __asm__ ("%ebx");
- return *got;
+ /* This produces a GOTOFF reloc that resolves to zero at link time, so in
+ fact just loads from the GOT register directly. By doing it without
+ an asm we can let the compiler choose any register. */
+ return _GLOBAL_OFFSET_TABLE_[0];
}
+extern Elf32_Dyn bygotoff[] __asm__ ("_DYNAMIC") attribute_hidden;
/* Return the run-time load address of the shared object. */
-static __always_inline Elf32_Addr elf_machine_load_address (void) attribute_unused;
-static __always_inline Elf32_Addr
+static __always_inline Elf32_Addr attribute_unused
elf_machine_load_address (void)
{
- /* It doesn't matter what variable this is, the reference never makes
- it to assembly. We need a dummy reference to some global variable
- via the GOT to make sure the compiler initialized %ebx in time. */
- Elf32_Addr addr;
- int tmp;
- __asm__ ("leal _dl_start@GOTOFF(%%ebx), %0\n"
- "subl _dl_start@GOT(%%ebx), %0"
- : "=r" (addr) : "m" (tmp) : "cc");
- return addr;
+ /* Compute the difference between the runtime address of _DYNAMIC as seen
+ by a GOTOFF reference, and the link-time address found in the special
+ unrelocated first GOT entry. */
+ return (Elf32_Addr) &bygotoff - elf_machine_dynamic ();
}
static __always_inline void
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 1d81dc5276b78a6f893c35ffd80bbf331d4f0833 (commit)
from 96807d27a3ea01f427b6b98618ca87e9c1c00683 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1d81dc5276b78a6f893c35ffd80bbf331d4f0833
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Tue Jun 23 21:18:49 2015 +0200
add patch from ldso-future branch
Fixes segfaults when gcc 5.1 is used for x86.
http://git.uclibc.org/uClibc/commit/ldso/ldso/i386/dl-sysdep.h?h=ldso-futur…
Mentioned in #uclibc.
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/i386/dl-sysdep.h | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index a66c802..8efa1a8 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -37,31 +37,27 @@ extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_ent
| (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
-static __always_inline Elf32_Addr elf_machine_dynamic (void) attribute_unused;
-static __always_inline Elf32_Addr
+ first element of the GOT, a special entry that is never relocated. */
+extern const Elf32_Addr _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
+static __always_inline Elf32_Addr __attribute__ ((unused, const))
elf_machine_dynamic (void)
{
- register Elf32_Addr *got __asm__ ("%ebx");
- return *got;
+ /* This produces a GOTOFF reloc that resolves to zero at link time, so in
+ fact just loads from the GOT register directly. By doing it without
+ an asm we can let the compiler choose any register. */
+ return _GLOBAL_OFFSET_TABLE_[0];
}
+extern Elf32_Dyn bygotoff[] __asm__ ("_DYNAMIC") attribute_hidden;
/* Return the run-time load address of the shared object. */
-static __always_inline Elf32_Addr elf_machine_load_address (void) attribute_unused;
-static __always_inline Elf32_Addr
+static __always_inline Elf32_Addr attribute_unused
elf_machine_load_address (void)
{
- /* It doesn't matter what variable this is, the reference never makes
- it to assembly. We need a dummy reference to some global variable
- via the GOT to make sure the compiler initialized %ebx in time. */
- Elf32_Addr addr;
- int tmp;
- __asm__ ("leal _dl_start@GOTOFF(%%ebx), %0\n"
- "subl _dl_start@GOT(%%ebx), %0"
- : "=r" (addr) : "m" (tmp) : "cc");
- return addr;
+ /* Compute the difference between the runtime address of _DYNAMIC as seen
+ by a GOTOFF reference, and the link-time address found in the special
+ unrelocated first GOT entry. */
+ return (Elf32_Addr) &bygotoff - elf_machine_dynamic ();
}
static __always_inline void
hooks/post-receive
--
uClibc-ng - small C library for embedded systems