From 488e56e0d9fca517e62a96d2eae5e1ef9fdb38bc Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Tue, 4 Jan 2011 14:16:50 +0100 Subject: nptl: get rid of preprocessor warning when __ASSUME_TGKILL is not defined A sample of the warning reported while building for ARM that has not __ASSUME_TGKILL defined. libpthread/nptl/sysdeps/unix/sysv/linux/raise.c: In function 'raise': libpthread/nptl/sysdeps/unix/sysv/linux/raise.c:33:5: warning: "__ASSUME_TGKILL" is not defined Signed-off-by: Carmelo Amoroso --- libpthread/nptl/pthread_cancel.c | 2 +- libpthread/nptl/sysdeps/pthread/createthread.c | 2 +- libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c | 4 ++-- libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c | 2 +- libpthread/nptl/sysdeps/unix/sysv/linux/raise.c | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libpthread/nptl/pthread_cancel.c b/libpthread/nptl/pthread_cancel.c index 4a958bcde..163fa0243 100644 --- a/libpthread/nptl/pthread_cancel.c +++ b/libpthread/nptl/pthread_cancel.c @@ -76,7 +76,7 @@ pthread_cancel ( a signal handler. But this is no allowed, pthread_cancel is not guaranteed to be async-safe. */ int val; -#if __ASSUME_TGKILL +#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), pd->tid, SIGCANCEL); diff --git a/libpthread/nptl/sysdeps/pthread/createthread.c b/libpthread/nptl/sysdeps/pthread/createthread.c index a676e277f..ce86f5f33 100644 --- a/libpthread/nptl/sysdeps/pthread/createthread.c +++ b/libpthread/nptl/sysdeps/pthread/createthread.c @@ -106,7 +106,7 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr, send it the cancellation signal. */ INTERNAL_SYSCALL_DECL (err2); err_out: -#if __ASSUME_TGKILL +#if defined (__ASSUME_TGKILL) && __ASSUME_TGKILL (void) INTERNAL_SYSCALL (tgkill, err2, 3, THREAD_GETMEM (THREAD_SELF, pid), pd->tid, SIGCANCEL); diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c index d256ebcb0..622bb66ca 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-raise.c @@ -28,7 +28,7 @@ int raise ( int sig) { -#if __ASSUME_TGKILL || defined __NR_tgkill +#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill /* raise is an async-safe function. It could be called while the fork function temporarily invalidated the PID field. Adjust for that. */ @@ -37,7 +37,7 @@ raise ( pid = -pid; #endif -#if __ASSUME_TGKILL +#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid), sig); #else diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c index 3a70c3764..2d6bb8002 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_kill.c @@ -59,7 +59,7 @@ __pthread_kill ( fork, it would have to happen in a signal handler. But this is no allowed, pthread_kill is not guaranteed to be async-safe. */ int val; -#if __ASSUME_TGKILL +#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), tid, signo); #else diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c b/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c index da35cfe9f..708ed6d76 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/raise.c @@ -30,7 +30,7 @@ raise ( int sig) { struct pthread *pd = THREAD_SELF; -#if __ASSUME_TGKILL || defined __NR_tgkill +#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill pid_t pid = THREAD_GETMEM (pd, pid); #endif pid_t selftid = THREAD_GETMEM (pd, tid); @@ -45,13 +45,13 @@ raise ( #endif THREAD_SETMEM (pd, tid, selftid); -#if __ASSUME_TGKILL || defined __NR_tgkill +#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill /* We do not set the PID field in the TID here since we might be called from a signal handler while the thread executes fork. */ pid = selftid; #endif } -#if __ASSUME_TGKILL || defined __NR_tgkill +#if (defined(__ASSUME_TGKILL) && __ASSUME_TGKILL) || defined __NR_tgkill else /* raise is an async-safe function. It could be called while the fork/vfork function temporarily invalidated the PID field. Adjust for @@ -60,7 +60,7 @@ raise ( pid = (pid & INT_MAX) == 0 ? selftid : -pid; #endif -#if __ASSUME_TGKILL +#if defined(__ASSUME_TGKILL) && __ASSUME_TGKILL return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); #else # ifdef __NR_tgkill -- cgit v1.2.3 From e5ac9973e93c96804eb9ed7f865853e522f1baca Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 5 Jan 2011 09:03:28 +0100 Subject: Revert "Makefile.in: Add header to 'all' target" The respective source has to depend on a given set of headers. Depending all on headers is papering over an eventual missing other dependency, so reverting. This reverts commit 4d81f2a74578f819285b131c682e8d2f6c315c4e. --- Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index d7a5fca60..b4dcf6bfd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -23,7 +23,7 @@ export KCONFIG_CONFIG ifeq ($(HAVE_DOT_CONFIG),y) -all: headers pregen libs +all: pregen libs libs: pregen # In this section, we need .config @@ -260,7 +260,6 @@ HEADERS_RM-$(UCLIBC_HAS_WCHAR) += wchar.h wctype.h HEADERS_RM-$(UCLIBC_HAS_WORDEXP) += wordexp.h HEADERS_RM-$(UCLIBC_HAS_XATTR) += sys/xattr.h HEADERS_RM-$(UCLIBC_HAS_XLOCALE) += xlocale.h -HEADERS_RM-$(UCLIBC_HAS_LOCALE) += bits/uClibc_ctype.h HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += sys/fsuid.h sys/inotify.h sys/perm.h \ sys/personality.h \ sys/prctl.h \ -- cgit v1.2.3 From b4a3345ea8f19d7be5d45e183a97f44854fc5998 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 5 Jan 2011 09:06:10 +0100 Subject: remove uClibc_ctype.h if !LOCALE Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index b4dcf6bfd..0a07888f0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -241,7 +241,7 @@ HEADERS_RM-$(UCLIBC_HAS_GNU_ERROR) += error.h HEADERS_RM-$(UCLIBC_HAS_GNU_GETOPT)$(UCLIBC_HAS_GETOPT_LONG) += getopt.h HEADERS_RM-$(UCLIBC_HAS_IPV6) += netinet/ip6.h netinet/icmp6.h HEADERS_RM-$(UCLIBC_HAS_BACKTRACE) += execinfo.h -HEADERS_RM-$(UCLIBC_HAS_LOCALE) += iconv.h +HEADERS_RM-$(UCLIBC_HAS_LOCALE) += iconv.h bits/uClibc_ctype.h HEADERS_RM-$(UCLIBC_HAS_PTY) += pty.h HEADERS_RM-$(UCLIBC_HAS_REALTIME) += mqueue.h bits/mqueue.h sched.h \ bits/sched.h \ -- cgit v1.2.3 From 8958a63759c2ae23b47e76efeed1b7fc1f22728c Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Wed, 5 Jan 2011 17:22:25 +0100 Subject: nptl: get rid of the last preprocessor warning when __ASSUME_TGKILL is not defined A missing change in the previous commit. Signed-off-by: Carmelo Amoroso --- libpthread/nptl/allocatestack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 9ffa7e7e2..1c549cee1 100644 --- a/libpthread/nptl/allocatestack.c +++ b/libpthread/nptl/allocatestack.c @@ -993,7 +993,7 @@ setxid_signal_thread (struct xid_command *cmdp, struct pthread *t) int val; INTERNAL_SYSCALL_DECL (err); -#if __ASSUME_TGKILL +#if defined (__ASSUME_TGKILL) && __ASSUME_TGKILL val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), t->tid, SIGSETXID); #else -- cgit v1.2.3 From 6a171a2bfc2326e57501c9e50bc28f0a8f820252 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 6 Jan 2011 08:28:34 +0100 Subject: buildsys: fix make release target According to git man page the syntax for git archive should have the as last argument. Indeed using git 1.5.5.6 the tarball was not properly created. Newer version (i.e. 1.6.3.3) works fine even if HEAD comes before other option. For backward compatibility use a syntax that is fine with older git. Signed-off-by: Carmelo Amoroso --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 0a07888f0..ecb9cd994 100644 --- a/Makefile.in +++ b/Makefile.in @@ -475,7 +475,7 @@ distclean: clean dist release: $(RM) ../uClibc-$(VERSION).tar - git archive HEAD --format=tar --prefix=uClibc-$(VERSION)/ \ + git archive --format=tar --prefix=uClibc-$(VERSION)/ HEAD \ > ../uClibc-$(VERSION).tar cat ../uClibc-$(VERSION).tar | bzip2 -c9 > ../uClibc-$(VERSION).tar.bz2 cat ../uClibc-$(VERSION).tar | xz -e -c8 > ../uClibc-$(VERSION).tar.xz -- cgit v1.2.3 From 8764f2e75c875757529aa81e5cd96e17e6f6e5e4 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Wed, 5 Jan 2011 14:38:13 +0100 Subject: buildsys: headers target should not depend on sysnum.h The generation of the sysnum.h has to be a prerequisite of 'pregen' target instead of headers, because it needs the compiler already available. The so called C bootstrap headers are required to build the compiler by invoking 'make headers', so the 'headers' target cannot relies itself on the compiler to be invoked. Signed-off-by: Carmelo Amoroso --- Makefile.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index ecb9cd994..ab5ab7286 100644 --- a/Makefile.in +++ b/Makefile.in @@ -158,11 +158,12 @@ headers_clean-y += HEADERCLEAN_common # libc/sysdeps/linux/Makefile.commonarch to headers-y headers-y += $(target-headers-sysdep) -headers: $(top_builddir)include/bits/uClibc_config.h $(top_builddir)include/bits/sysnum.h | subdirs +headers: $(top_builddir)include/bits/uClibc_config.h | subdirs subdirs: $(addprefix $(top_builddir),$(subdirs)) -pregen-headers: $(pregen-headers-y) +pregen-headers: $(top_builddir)include/bits/sysnum.h $(pregen-headers-y) pregen: pregen-headers $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers) + $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh | $(top_builddir)include/bits @$(disp_gen) $(Q)set -e; \ -- cgit v1.2.3 From e0d2b8e59beba49d6c2bdcf24257cc1834ce2b26 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 11 Jan 2011 19:46:56 +0100 Subject: __psfs_parse_spec: always use long int for %p closes bug #3037 Signed-off-by: Bernhard Reutner-Fischer --- libc/stdio/_scanf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c index 34c1c9abd..28cd21e30 100644 --- a/libc/stdio/_scanf.c +++ b/libc/stdio/_scanf.c @@ -924,7 +924,10 @@ int attribute_hidden __psfs_parse_spec(register psfs_t *psfs) goto ERROR_EINVAL; } - if ((p_m_spec_chars >= CONV_c) + if (p_m_spec_chars == CONV_p) { + /* a pointer has the same size as 'long int' */ + psfs->dataargtype = PA_FLAG_LONG; + } else if ((p_m_spec_chars >= CONV_c) && (psfs->dataargtype & PA_FLAG_LONG)) { p_m_spec_chars -= 3; /* lc -> C, ls -> S, l[ -> ?? */ } -- cgit v1.2.3 From 8fdc17c2ba1322712604d88dca48157068e6aadb Mon Sep 17 00:00:00 2001 From: Roman I Khimov Date: Thu, 23 Dec 2010 11:57:49 +0300 Subject: syslog: fix 'everyone logs with user facility' It's been found that on uclibc-based system most of the programs log with 'user' facility despite the calls to openlog() with other facilities explicitly set. Most but not all. Investigating that I've found that the ones logging with proper facilities used LOG_NDELAY in openlog(). The problem is that LogFacility is overwritten in openlog_intern and LOG_USER is passed to it from vsyslog() no matter what the program set with openlog(). Signed-off-by: Roman I Khimov Signed-off-by: Bernhard Reutner-Fischer --- libc/misc/syslog/syslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c index b10a55615..f1b848f0b 100644 --- a/libc/misc/syslog/syslog.c +++ b/libc/misc/syslog/syslog.c @@ -205,7 +205,7 @@ vsyslog(int pri, const char *fmt, va_list ap) if ((LogMask & LOG_MASK(LOG_PRI(pri))) == 0) goto getout; if (LogFile < 0 || !connected) - openlog_intern(NULL, LogStat | LOG_NDELAY, LOG_USER); + openlog_intern(NULL, LogStat | LOG_NDELAY, (int)LogFacility << 3); /* Set default facility if none specified. */ if ((pri & LOG_FACMASK) == 0) -- cgit v1.2.3 From 387b2e49cbb6aedcc6136fb18fb232dada563cf6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 15 Jan 2011 16:21:43 -0800 Subject: cris: Fix build issues Thanks Waldemar Brodkorb for reporting Signed-off-by: Khem Raj --- libc/sysdeps/linux/cris/sys/user.h | 81 ++++++++++++++++++++++++++++++++++++++ libc/sysdeps/linux/cris/sysdep.h | 2 + 2 files changed, 83 insertions(+) create mode 100644 libc/sysdeps/linux/cris/sys/user.h diff --git a/libc/sysdeps/linux/cris/sys/user.h b/libc/sysdeps/linux/cris/sys/user.h new file mode 100644 index 000000000..d629c30d7 --- /dev/null +++ b/libc/sysdeps/linux/cris/sys/user.h @@ -0,0 +1,81 @@ +#ifndef __ASM_CRIS_USER_H +#define __ASM_CRIS_USER_H + +/* User-mode register used for core dumps. */ + +struct user_fpregs { +}; + +struct user_regs_struct { + unsigned long r0; /* General registers. */ + unsigned long r1; + unsigned long r2; + unsigned long r3; + unsigned long r4; + unsigned long r5; + unsigned long r6; + unsigned long r7; + unsigned long r8; + unsigned long r9; + unsigned long r10; + unsigned long r11; + unsigned long r12; + unsigned long r13; + unsigned long sp; /* R14, Stack pointer. */ + unsigned long acr; /* R15, Address calculation register. */ + unsigned long bz; /* P0, Constant zero (8-bits). */ + unsigned long vr; /* P1, Version register (8-bits). */ + unsigned long pid; /* P2, Process ID (8-bits). */ + unsigned long srs; /* P3, Support register select (8-bits). */ + unsigned long wz; /* P4, Constant zero (16-bits). */ + unsigned long exs; /* P5, Exception status. */ + unsigned long eda; /* P6, Exception data address. */ + unsigned long mof; /* P7, Multiply overflow regiter. */ + unsigned long dz; /* P8, Constant zero (32-bits). */ + unsigned long ebp; /* P9, Exception base pointer. */ + unsigned long erp; /* P10, Exception return pointer. */ + unsigned long srp; /* P11, Subroutine return pointer. */ + unsigned long nrp; /* P12, NMI return pointer. */ + unsigned long ccs; /* P13, Condition code stack. */ + unsigned long usp; /* P14, User mode stack pointer. */ + unsigned long spc; /* P15, Single step PC. */ +}; + +/* + * Core file format: The core file is written in such a way that gdb + * can understand it and provide useful information to the user (under + * linux we use the `trad-core' bfd). The file contents are as follows: + * + * upage: 1 page consisting of a user struct that tells gdb + * what is present in the file. Directly after this is a + * copy of the task_struct, which is currently not used by gdb, + * but it may come in handy at some point. All of the registers + * are stored as part of the upage. The upage should always be + * only one page long. + * data: The data segment follows next. We use current->end_text to + * current->brk to pick up all of the user variables, plus any memory + * that may have been sbrk'ed. No attempt is made to determine if a + * page is demand-zero or if a page is totally unused, we just cover + * the entire range. All of the addresses are rounded in such a way + * that an integral number of pages is written. + * stack: We need the stack information in order to get a meaningful + * backtrace. We need to write the data from usp to + * current->start_stack, so we round each of these in order to be able + * to write an integer number of pages. + */ + +struct user { + struct user_regs_struct regs; /* entire machine state */ + size_t u_tsize; /* text size (pages) */ + size_t u_dsize; /* data size (pages) */ + size_t u_ssize; /* stack size (pages) */ + unsigned long start_code; /* text starting address */ + unsigned long start_data; /* data starting address */ + unsigned long start_stack; /* stack starting address */ + long int signal; /* signal causing core dump */ + unsigned long u_ar0; /* help gdb find registers */ + unsigned long magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ +}; + +#endif /* __ASM_CRIS_USER_H */ diff --git a/libc/sysdeps/linux/cris/sysdep.h b/libc/sysdeps/linux/cris/sysdep.h index 593e7772e..5960fe235 100644 --- a/libc/sysdeps/linux/cris/sysdep.h +++ b/libc/sysdeps/linux/cris/sysdep.h @@ -20,6 +20,8 @@ #ifndef _SYSDEP_H_ #define _SYSDEP_H_ +#include + #ifndef C_LABEL /* Define a macro we can use to construct the asm name for a C symbol. */ -- cgit v1.2.3 From 68115c38cef4bddb52928e58cdefcb45855bc6f4 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 20 Jan 2011 14:46:44 +0100 Subject: Revert "ldso/i386: support protected symbols" This reverts commit ba38f0cec27b91cc7c605417ad047c4dc77d732f. The generic implementation will cover all the architectures handling the protected symbols in _dl_lookup_hash [ldso/ldso/dl-hash.c] Signed-off-by: Carmelo Amoroso --- ldso/ldso/i386/elfinterp.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c index 1e3a2b248..a01c1d020 100644 --- a/ldso/ldso/i386/elfinterp.c +++ b/ldso/ldso/i386/elfinterp.c @@ -175,9 +175,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, symbol_addr = 0; symname = strtab + symtab[symtab_index].st_name; - if (symtab_index && - (ELF32_ST_VISIBILITY(symtab[symtab_index].st_other) - != STV_PROTECTED)) { + if (symtab_index) { symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt, elf_machine_type_class(reloc_type), &tls_tpnt); @@ -190,11 +188,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) return 1; } else { - if (symtab_index) - symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class(reloc_type), - &symtab[symtab_index]); - else - symbol_addr = symtab[symtab_index].st_value; + symbol_addr = symtab[symtab_index].st_value; tls_tpnt = tpnt; } -- cgit v1.2.3 From 83daa843d8d165857453a491e366bd13d360b0d4 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 20 Jan 2011 14:47:14 +0100 Subject: Revert "ldso_sh: add support for protected symbols to SH" This reverts commit 74407db52d3953c7f3c6b8a53661cfc96cb07e22. The generic implementation will cover all the architectures handling the protected symbols in _dl_lookup_hash [ldso/ldso/dl-hash.c] Signed-off-by: Carmelo Amoroso --- ldso/ldso/sh/elfinterp.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c index 756f6c443..715eadc15 100644 --- a/ldso/ldso/sh/elfinterp.c +++ b/ldso/ldso/sh/elfinterp.c @@ -166,32 +166,26 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; + symname = strtab + symtab[symtab_index].st_name; if (symtab_index) { - symname = strtab + symtab[symtab_index].st_name; - if (ELF32_ST_VISIBILITY(symtab[symtab_index].st_other) - != STV_PROTECTED) { - symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &tls_tpnt); - /* - * We want to allow undefined references to weak symbols - this might - * have been intentional. We should not be linking local symbols - * here, so all bases should be covered. - */ - - if (!symbol_addr - && (ELF_ST_TYPE(symtab[symtab_index].st_info) != STT_TLS) - && (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) { - _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", - _dl_progname, strtab + symtab[symtab_index].st_name); - - /* Let the caller to handle the error: it may be non fatal if called from dlopen */ - return 1; - } - } else - /* Resolve protected symbols locally */ - symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class(reloc_type), - &symtab[symtab_index]); + symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt, + elf_machine_type_class(reloc_type), &tls_tpnt); + /* + * We want to allow undefined references to weak symbols - this might + * have been intentional. We should not be linking local symbols + * here, so all bases should be covered. + */ + + if (!symbol_addr + && (ELF_ST_TYPE(symtab[symtab_index].st_info) != STT_TLS) + && (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) { + _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", + _dl_progname, strtab + symtab[symtab_index].st_name); + + /* Let the caller to handle the error: it may be non fatal if called from dlopen */ + return 1; + } } #if defined (__SUPPORT_LD_DEBUG__) -- cgit v1.2.3 From c70ac1d9b290e70cbc789b0abb47337f8aa9faef Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 20 Jan 2011 14:47:46 +0100 Subject: Revert "ldso/arm: Correct protected symbol resolution" This reverts commit 48fb264beaac8114e5ac3e80e70dda473fbce96d. The generic implementation will cover all the architectures handling the protected symbols in _dl_lookup_hash [ldso/ldso/dl-hash.c] Signed-off-by: Carmelo Amoroso --- ldso/ldso/arm/elfinterp.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c index adc282a57..9bbf92c8c 100644 --- a/ldso/ldso/arm/elfinterp.c +++ b/ldso/ldso/arm/elfinterp.c @@ -198,9 +198,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; - if (symtab_index && - (ELF32_ST_VISIBILITY(symtab[symtab_index].st_other) - != STV_PROTECTED)) { + if (symtab_index) { symbol_addr = _dl_find_hash(strtab + symtab[symtab_index].st_name, scope, tpnt, elf_machine_type_class(reloc_type), &def_mod); @@ -221,12 +219,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, * symbol value of zero, and using the module containing the * reloc itself. */ - if (symtab_index) - symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class(reloc_type), - &symtab[symtab_index]); - else - symbol_addr = symtab[symtab_index].st_value; - + symbol_addr = symtab[symtab_index].st_value; def_mod = tpnt; } -- cgit v1.2.3 From aaf4cbd98fda76af93ebea5241f65291ff6bcaac Mon Sep 17 00:00:00 2001 From: Salvatore Cro Date: Wed, 12 Jan 2011 10:27:16 +0100 Subject: Add protected symbols support for all architectures Protected symbols are global symbols for which interposition is not allowed. We manage them in generic _dl_lookup_hash function. To handle protected symbols we need to get a reference to the module that defines the symbol itself. So we pass a new parameter 'struct symbol_ref' to the __dl_lookup_hash that is defined as below: struct symbol_ref { const ElfW(Sym) *sym; struct elf_resolve *tpnt; }; The tpnt field is used as an ouput parameter and refers to the module which defines the protected symbol. Further it can be used as output parameter for TLS relocations and FDPIC case. The sym field is instead used as an input parameter to detect the visibility of the symbol we are looking-up. In this way we get rid of different signatures for _dl_lookup_hash, allowing to remove the _dl_find_hash wrapper. This new structure is also suitable for prelink integration. Signed-off-by: Salvatore Cro Signed-off-by: Carmelo Amoroso --- ldso/include/dl-hash.h | 16 ++++++++-------- ldso/ldso/arm/elfinterp.c | 6 +++++- ldso/ldso/avr32/elfinterp.c | 13 +++++++------ ldso/ldso/bfin/elfinterp.c | 18 ++++++++++++------ ldso/ldso/cris/elfinterp.c | 5 ++++- ldso/ldso/dl-hash.c | 20 ++++++++++++-------- ldso/ldso/i386/elfinterp.c | 6 +++++- ldso/ldso/m68k/elfinterp.c | 15 ++++++++------- ldso/ldso/mips/elfinterp.c | 22 +++++++++++++--------- ldso/ldso/powerpc/elfinterp.c | 20 +++++++++++--------- ldso/ldso/sh/elfinterp.c | 10 +++++++--- ldso/ldso/sh64/elfinterp.c | 7 +++++-- ldso/ldso/sparc/elfinterp.c | 24 +++++++++++++----------- ldso/ldso/x86_64/elfinterp.c | 20 +++++++++++--------- ldso/ldso/xtensa/elfinterp.c | 11 ++++++----- ldso/libdl/libdl.c | 7 ++++--- 16 files changed, 131 insertions(+), 89 deletions(-) diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h index 34bed1b4b..d1f9accc5 100644 --- a/ldso/include/dl-hash.h +++ b/ldso/include/dl-hash.h @@ -25,6 +25,11 @@ struct dyn_elf { struct dyn_elf * prev; }; +struct symbol_ref { + const ElfW(Sym) *sym; + struct elf_resolve *tpnt; +}; + struct elf_resolve { /* These entries must be in this order to be compatible with the interface used by gdb to obtain the list of symbols. */ @@ -137,19 +142,14 @@ extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname, DL_LOADADDR_TYPE loadaddr, unsigned long * dynamic_info, unsigned long dynamic_addr, unsigned long dynamic_size); -/* Only need extra arg with some configurations */ -#if !((defined(USE_TLS) && USE_TLS) || defined __FDPIC__) -# define _dl_lookup_hash(n, r, m, c, tpntp) _dl_lookup_hash(n, r, m, c) -# define _dl_find_hash(n, r, m, t, tpntp) _dl_find_hash(n, r, m, t) -#endif extern char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *mytpnt, int type_class, - struct elf_resolve **tpntp); + struct symbol_ref *symbol); static __always_inline char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *mytpnt, int type_class, - struct elf_resolve **tpntp) + struct symbol_ref *symbol) { - return _dl_lookup_hash(name, rpnt, mytpnt, type_class, tpntp); + return _dl_lookup_hash(name, rpnt, mytpnt, type_class, symbol); } extern int _dl_linux_dynamic_link(void); diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c index 9bbf92c8c..707b31743 100644 --- a/ldso/ldso/arm/elfinterp.c +++ b/ldso/ldso/arm/elfinterp.c @@ -189,6 +189,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, unsigned long *reloc_addr; unsigned long symbol_addr; const Elf32_Sym *def = 0; + struct symbol_ref sym_ref; struct elf_resolve *def_mod = 0; int goof = 0; @@ -197,10 +198,12 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; if (symtab_index) { symbol_addr = _dl_find_hash(strtab + symtab[symtab_index].st_name, - scope, tpnt, elf_machine_type_class(reloc_type), &def_mod); + scope, tpnt, elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this might @@ -213,6 +216,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, return 1; } + def_mod = sym_ref.tpnt; } else { /* * Relocs against STN_UNDEF are usually treated as using a diff --git a/ldso/ldso/avr32/elfinterp.c b/ldso/ldso/avr32/elfinterp.c index 797f8513e..2d0dbf366 100644 --- a/ldso/ldso/avr32/elfinterp.c +++ b/ldso/ldso/avr32/elfinterp.c @@ -50,9 +50,8 @@ unsigned long _dl_linux_resolver(unsigned long got_offset, unsigned long *got) strtab = (char *)(tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr); symname = strtab + sym->st_name; - new_addr = (unsigned long) _dl_find_hash(strtab + sym->st_name, - tpnt->symbol_scope, tpnt, - resolver); + new_addr = (unsigned long) _dl_find_hash(symname, + tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL); entry = (unsigned long *)(got + local_gotno + sym_index - gotsym); *entry = new_addr; @@ -127,18 +126,20 @@ static int _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined(__SUPPORT_LD_DEBUG__) unsigned long old_val; #endif + struct symbol_ref sym_ref; reloc_addr = (unsigned long *)(tpnt->loadaddr + rpnt->r_offset); reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symname = strtab + symtab[symtab_index].st_name; if (symtab_index) { symbol_addr = (unsigned long) - _dl_find_hash(strtab + symtab[symtab_index].st_name, - tpnt->symbol_scope, tpnt, - elf_machine_type_class(reloc_type), NULL); + _dl_find_hash(symname, scope, tpnt, + elf_machine_type_class(reloc_type), &sym_ref); /* Allow undefined references to weak symbols */ if (!symbol_addr && diff --git a/ldso/ldso/bfin/elfinterp.c b/ldso/ldso/bfin/elfinterp.c index e8d88bd5a..5accbfc2c 100644 --- a/ldso/ldso/bfin/elfinterp.c +++ b/ldso/ldso/bfin/elfinterp.c @@ -46,11 +46,11 @@ _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) ElfW(Sym) *symtab; int symtab_index; char *rel_addr; - struct elf_resolve *new_tpnt; char *new_addr; struct funcdesc_value funcval; struct funcdesc_value volatile *got_entry; char *symname; + struct symbol_ref sym_ref; rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; @@ -59,15 +59,17 @@ _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) symtab = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symname= strtab + symtab[symtab_index].st_name; /* Address of GOT entry fix up */ got_entry = (struct funcdesc_value *) DL_RELOC_ADDR(tpnt->loadaddr, this_reloc->r_offset); /* Get the address to be used to fill in the GOT entry. */ - new_addr = _dl_lookup_hash(symname, tpnt->symbol_scope, NULL, 0, &new_tpnt); + new_addr = _dl_lookup_hash(symname, tpnt->symbol_scope, NULL, 0, &sym_ref); if (!new_addr) { - new_addr = _dl_lookup_hash(symname, NULL, NULL, 0, &new_tpnt); + new_addr = _dl_lookup_hash(symname, NULL, NULL, 0, &sym_ref); if (!new_addr) { _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname); @@ -76,7 +78,7 @@ _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) } funcval.entry_point = new_addr; - funcval.got_value = new_tpnt->loadaddr.got_value; + funcval.got_value = sym_ref.tpnt->loadaddr.got_value; #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_bindings) { @@ -165,12 +167,15 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) unsigned long old_val; #endif + struct symbol_ref sym_ref; reloc_addr = (unsigned long *) DL_RELOC_ADDR(tpnt->loadaddr, rpnt->r_offset); __asm__ ("" : "=r" (reloc_addr_packed) : "0" (reloc_addr)); reloc_type = ELF_R_TYPE(rpnt->r_info); symtab_index = ELF_R_SYM(rpnt->r_info); symbol_addr = 0; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symname = strtab + symtab[symtab_index].st_name; if (ELF_ST_BIND (symtab[symtab_index].st_info) == STB_LOCAL) { @@ -179,7 +184,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, } else { symbol_addr = (unsigned long) - _dl_lookup_hash(symname, scope, NULL, 0, &symbol_tpnt); + _dl_lookup_hash(symname, scope, NULL, 0, &sym_ref); /* * We want to allow undefined references to weak symbols - this might @@ -189,9 +194,10 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, if (!symbol_addr && ELF_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK) { _dl_dprintf (2, "%s: can't resolve symbol '%s'\n", - _dl_progname, strtab + symtab[symtab_index].st_name); + _dl_progname, symname); _dl_exit (1); } + symbol_tpnt = sym_ref.tpnt; } #if defined (__SUPPORT_LD_DEBUG__) diff --git a/ldso/ldso/cris/elfinterp.c b/ldso/ldso/cris/elfinterp.c index 32ea2da9e..3cb8297e1 100644 --- a/ldso/ldso/cris/elfinterp.c +++ b/ldso/ldso/cris/elfinterp.c @@ -161,11 +161,14 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) unsigned long old_val; #endif + struct symbol_ref sym_ref; reloc_addr = (unsigned long *)(intptr_t)(tpnt->loadaddr + (unsigned long)rpnt->r_offset); reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symname = strtab + symtab[symtab_index].st_name; if (symtab_index) { @@ -174,7 +177,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, symbol_addr = (unsigned long)tpnt->loadaddr; } else { symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), NULL); + elf_machine_type_class(reloc_type), &sym_ref); } if (unlikely(!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) { diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c index 0048734ba..6db81a90c 100644 --- a/ldso/ldso/dl-hash.c +++ b/ldso/ldso/dl-hash.c @@ -269,7 +269,7 @@ _dl_lookup_sysv_hash(struct elf_resolve *tpnt, ElfW(Sym) *symtab, unsigned long * relocations or when we call an entry in the PLT table for the first time. */ char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *mytpnt, - int type_class, struct elf_resolve **tpntp) + int type_class, struct symbol_ref *sym_ref) { struct elf_resolve *tpnt = NULL; ElfW(Sym) *symtab; @@ -283,6 +283,11 @@ char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve unsigned long gnu_hash_number = _dl_gnu_hash((const unsigned char *)name); #endif + if ((sym_ref) && (sym_ref->sym) && (ELF32_ST_VISIBILITY(sym_ref->sym->st_other) == STV_PROTECTED)) { + sym = sym_ref->sym; + if (mytpnt) + tpnt = mytpnt; + } else for (; rpnt; rpnt = rpnt->next) { tpnt = rpnt->dyn; @@ -337,9 +342,8 @@ char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve /* At this point we have found the requested symbol, do binding */ #if defined(USE_TLS) && USE_TLS if (ELF_ST_TYPE(sym->st_info) == STT_TLS) { - _dl_assert(tpntp != NULL); - *tpntp = tpnt; - + _dl_assert(sym_ref != NULL); + sym_ref->tpnt = tpnt; return (char *)sym->st_value; } #endif @@ -355,8 +359,8 @@ char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve #endif case STB_GLOBAL: #ifdef __FDPIC__ - if (tpntp) - *tpntp = tpnt; + if (sym_ref) + sym_ref->tpnt = tpnt; #endif return (char *)DL_FIND_HASH_VALUE(tpnt, type_class, sym); default: /* Local symbols not handled here */ @@ -364,8 +368,8 @@ char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve } } #ifdef __FDPIC__ - if (tpntp) - *tpntp = tpnt; + if (sym_ref) + sym_ref->tpnt = tpnt; #endif return weak_result; } diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c index a01c1d020..0017c239b 100644 --- a/ldso/ldso/i386/elfinterp.c +++ b/ldso/ldso/i386/elfinterp.c @@ -168,16 +168,19 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) unsigned long old_val; #endif + struct symbol_ref sym_ref; reloc_addr = (unsigned long *)(intptr_t)(tpnt->loadaddr + (unsigned long)rpnt->r_offset); reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symname = strtab + symtab[symtab_index].st_name; if (symtab_index) { symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &tls_tpnt); + elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this @@ -187,6 +190,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, if (unlikely(!symbol_addr && (ELF_ST_TYPE(symtab[symtab_index].st_info) != STT_TLS) && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) return 1; + tls_tpnt = sym_ref.tpnt; } else { symbol_addr = symtab[symtab_index].st_value; tls_tpnt = tpnt; diff --git a/ldso/ldso/m68k/elfinterp.c b/ldso/ldso/m68k/elfinterp.c index 04c301ebb..3dfd50e96 100644 --- a/ldso/ldso/m68k/elfinterp.c +++ b/ldso/ldso/m68k/elfinterp.c @@ -157,7 +157,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, int reloc_type; int symtab_index; char *symname; - ElfW(Sym) *sym; + struct symbol_ref sym_ref; ElfW(Addr) *reloc_addr; ElfW(Addr) symbol_addr; #if defined (__SUPPORT_LD_DEBUG__) @@ -167,19 +167,20 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, reloc_addr = (ElfW(Addr)*)(tpnt->loadaddr + (unsigned long)rpnt->r_offset); reloc_type = ELF_R_TYPE(rpnt->r_info); symtab_index = ELF_R_SYM(rpnt->r_info); - sym = &symtab[symtab_index]; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symbol_addr = 0; - symname = strtab + sym->st_name; + symname = strtab + sym_ref.sym->st_name; if (symtab_index) { symbol_addr = (ElfW(Addr))_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), NULL); + elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this * might have been intentional. We should not be linking local * symbols here, so all bases should be covered. */ - if (unlikely(!symbol_addr && ELF_ST_BIND(sym->st_info) != STB_WEAK)) { + if (unlikely(!symbol_addr && ELF_ST_BIND(sym_ref.sym->st_info) != STB_WEAK)) { _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname); _dl_exit(1); } @@ -230,12 +231,12 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, if (_dl_debug_move) _dl_dprintf(_dl_debug_file, "\t%s move %d bytes from %x to %x\n", - symname, sym->st_size, + symname, sym_ref.sym->st_size, symbol_addr, reloc_addr); #endif _dl_memcpy ((void *) reloc_addr, (void *) symbol_addr, - sym->st_size); + sym_ref.sym->st_size); } else _dl_dprintf(_dl_debug_file, "no symbol_addr to copy !?\n"); break; diff --git a/ldso/ldso/mips/elfinterp.c b/ldso/ldso/mips/elfinterp.c index a56ee81b4..2886f333d 100644 --- a/ldso/ldso/mips/elfinterp.c +++ b/ldso/ldso/mips/elfinterp.c @@ -212,23 +212,27 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt, case R_MIPS_TLS_TPREL32: # endif { - struct elf_resolve *tpnt_tls = NULL; + struct elf_resolve *tls_tpnt = NULL; + struct symbol_ref sym_ref; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; if (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_LOCAL) { symbol_addr = (unsigned long) _dl_find_hash(symname, tpnt->symbol_scope, - tpnt, elf_machine_type_class(reloc_type), &tpnt_tls); + tpnt, elf_machine_type_class(reloc_type), &sym_ref); + tls_tpnt = sym_ref.tpnt; } - /* In case of a TLS reloc, tpnt_tls NULL means we have an 'anonymous' + /* In case of a TLS reloc, tls_tpnt NULL means we have an 'anonymous' symbol. This is the case for a static tls variable, so the lookup module is just that one is referencing the tls variable. */ - if (!tpnt_tls) - tpnt_tls = tpnt; + if (!tls_tpnt) + tls_tpnt = tpnt; switch (reloc_type) { case R_MIPS_TLS_DTPMOD64: case R_MIPS_TLS_DTPMOD32: - if (tpnt_tls) - *(ElfW(Word) *)reloc_addr = tpnt_tls->l_tls_modid; + if (tls_tpnt) + *(ElfW(Word) *)reloc_addr = tls_tpnt->l_tls_modid; #ifdef __SUPPORT_LD_DEBUG__ _dl_dprintf(2, "TLS_DTPMOD : %s, %d, %d\n", symname, old_val, *((unsigned int *)reloc_addr)); @@ -247,9 +251,9 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt, case R_MIPS_TLS_TPREL32: case R_MIPS_TLS_TPREL64: - CHECK_STATIC_TLS((struct link_map *)tpnt_tls); + CHECK_STATIC_TLS((struct link_map *)tls_tpnt); *(ElfW(Word) *)reloc_addr += - TLS_TPREL_VALUE (tpnt_tls, symbol_addr); + TLS_TPREL_VALUE (tls_tpnt, symbol_addr); #ifdef __SUPPORT_LD_DEBUG__ _dl_dprintf(2, "TLS_TPREL : %s, %x, %x\n", symname, old_val, *((unsigned int *)reloc_addr)); diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c index 855c040d3..dd35eef54 100644 --- a/ldso/ldso/powerpc/elfinterp.c +++ b/ldso/ldso/powerpc/elfinterp.c @@ -187,7 +187,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, { int reloc_type; int symtab_index; - ElfW(Sym) *sym; + struct symbol_ref sym_ref; Elf32_Addr *reloc_addr; Elf32_Addr finaladdr; struct elf_resolve *tls_tpnt = NULL; @@ -201,21 +201,23 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, reloc_addr = (Elf32_Addr *)(intptr_t) (symbol_addr + (unsigned long) rpnt->r_offset); reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); - sym = &symtab[symtab_index]; - symname = strtab + sym->st_name; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; + symname = strtab + sym_ref.sym->st_name; if (symtab_index) { symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &tls_tpnt); + elf_machine_type_class(reloc_type), &sym_ref); /* We want to allow undefined references to weak symbols - this might * have been intentional. We should not be linking local symbols * here, so all bases should be covered. */ if (unlikely(!symbol_addr - && (ELF32_ST_TYPE(sym->st_info) != STT_TLS - && ELF32_ST_BIND(sym->st_info) != STB_WEAK))) + && (ELF32_ST_TYPE(sym_ref.sym->st_info) != STT_TLS + && ELF32_ST_BIND(sym_ref.sym->st_info) != STB_WEAK))) return 1; + tls_tpnt = sym_ref.tpnt; } else { - symbol_addr = sym->st_value; + symbol_addr = sym_ref.sym->st_value; tls_tpnt = tpnt; } #if defined (__SUPPORT_LD_DEBUG__) @@ -265,10 +267,10 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_move) _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x", - symname, sym->st_size, + symname, sym_ref.sym->st_size, symbol_addr, reloc_addr); #endif - _dl_memcpy((char *) reloc_addr, (char *) finaladdr, sym->st_size); + _dl_memcpy((char *) reloc_addr, (char *) finaladdr, sym_ref.sym->st_size); goto out_nocode; /* No code code modified */ case R_PPC_ADDR16_HA: finaladdr += 0x8000; /* fall through. */ diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c index 715eadc15..be3b98cf6 100644 --- a/ldso/ldso/sh/elfinterp.c +++ b/ldso/ldso/sh/elfinterp.c @@ -161,16 +161,19 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, #endif struct elf_resolve *tls_tpnt = NULL; + struct symbol_ref sym_ref; reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long) rpnt->r_offset); reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; - symname = strtab + symtab[symtab_index].st_name; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; if (symtab_index) { + symname = strtab + symtab[symtab_index].st_name; symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &tls_tpnt); + elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this might * have been intentional. We should not be linking local symbols @@ -181,11 +184,12 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, && (ELF_ST_TYPE(symtab[symtab_index].st_info) != STT_TLS) && (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) { _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", - _dl_progname, strtab + symtab[symtab_index].st_name); + _dl_progname, symname); /* Let the caller to handle the error: it may be non fatal if called from dlopen */ return 1; } + tls_tpnt = sym_ref.tpnt; } #if defined (__SUPPORT_LD_DEBUG__) diff --git a/ldso/ldso/sh64/elfinterp.c b/ldso/ldso/sh64/elfinterp.c index 74fda04dc..990aed155 100644 --- a/ldso/ldso/sh64/elfinterp.c +++ b/ldso/ldso/sh64/elfinterp.c @@ -173,11 +173,14 @@ static int _dl_do_reloc(struct elf_resolve *tpnt,struct dyn_elf *scope, #ifdef __SUPPORT_LD_DEBUG__ unsigned long old_val; #endif + struct symbol_ref sym_ref; reloc_type = ELF32_R_TYPE(rpnt->r_info); symtab_index = ELF32_R_SYM(rpnt->r_info); symbol_addr = 0; lsb = !!(symtab[symtab_index].st_other & STO_SH5_ISA32); + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symname = strtab + symtab[symtab_index].st_name; reloc_addr = (unsigned long *)(intptr_t) (tpnt->loadaddr + (unsigned long)rpnt->r_offset); @@ -186,7 +189,7 @@ static int _dl_do_reloc(struct elf_resolve *tpnt,struct dyn_elf *scope, int stb; symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), NULL); + elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this @@ -197,7 +200,7 @@ static int _dl_do_reloc(struct elf_resolve *tpnt,struct dyn_elf *scope, if (stb != STB_WEAK && !symbol_addr) { _dl_dprintf (2, "%s: can't resolve symbol '%s'\n", - _dl_progname, strtab + symtab[symtab_index].st_name); + _dl_progname, symname); _dl_exit (1); } } diff --git a/ldso/ldso/sparc/elfinterp.c b/ldso/ldso/sparc/elfinterp.c index 56335cb5c..443f65bde 100644 --- a/ldso/ldso/sparc/elfinterp.c +++ b/ldso/ldso/sparc/elfinterp.c @@ -171,7 +171,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, int symtab_index; char *symname; struct elf_resolve *tls_tpnt = 0; - ElfW(Sym) *sym; + struct symbol_ref sym_ref; ElfW(Addr) *reloc_addr; ElfW(Addr) symbol_addr; #if defined (__SUPPORT_LD_DEBUG__) @@ -181,29 +181,31 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, reloc_addr = (ElfW(Addr)*)(tpnt->loadaddr + (unsigned long)rpnt->r_offset); reloc_type = ELF_R_TYPE(rpnt->r_info); symtab_index = ELF_R_SYM(rpnt->r_info); - sym = &symtab[symtab_index]; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symbol_addr = 0; - symname = strtab + sym->st_name; + symname = strtab + sym_ref.sym->st_name; if (symtab_index) { symbol_addr = (ElfW(Addr))_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &tls_tpnt); + elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this * might have been intentional. We should not be linking local * symbols here, so all bases should be covered. */ - if (unlikely(!symbol_addr && (ELF_ST_TYPE(sym->st_info) != STT_TLS) - && (ELF_ST_BIND(sym->st_info) != STB_WEAK))) { + if (unlikely(!symbol_addr && (ELF_ST_TYPE(sym_ref.sym->st_info) != STT_TLS) + && (ELF_ST_BIND(sym_ref.sym->st_info) != STB_WEAK))) { /* This may be non-fatal if called from dlopen. */ return 1; } + tls_tpnt = sym_ref.tpnt; } else { /* Relocs against STN_UNDEF are usually treated as using a * symbol value of zero, and using the module containing the * reloc itself. */ - symbol_addr = sym->st_value; + symbol_addr = sym_ref.sym->st_value; tls_tpnt = tpnt; } @@ -262,13 +264,13 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, if (_dl_debug_move) _dl_dprintf(_dl_debug_file, "\t%s move %d bytes from %x to %x\n", - symname, sym->st_size, + symname, sym_ref.sym->st_size, symbol_addr, reloc_addr); #endif _dl_memcpy((char *)reloc_addr, (char *)symbol_addr, - sym->st_size); + sym_ref.sym->st_size); } else _dl_dprintf(_dl_debug_file, "no symbol_addr to copy !?\n"); break; @@ -280,7 +282,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, case R_SPARC_TLS_DTPOFF32: /* During relocation all TLS symbols are defined and used. * Therefore the offset is already correct. */ - *reloc_addr = sym->st_value + rpnt->r_addend; + *reloc_addr = sym_ref.sym->st_value + rpnt->r_addend; break; case R_SPARC_TLS_TPOFF32: @@ -289,7 +291,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, * It is a negative value which will be added to the * thread pointer. */ CHECK_STATIC_TLS ((struct link_map *) tls_tpnt); - *reloc_addr = sym->st_value - tls_tpnt->l_tls_offset + rpnt->r_addend; + *reloc_addr = sym_ref.sym->st_value - tls_tpnt->l_tls_offset + rpnt->r_addend; break; #endif default: diff --git a/ldso/ldso/x86_64/elfinterp.c b/ldso/ldso/x86_64/elfinterp.c index fce2ec7be..15d773388 100644 --- a/ldso/ldso/x86_64/elfinterp.c +++ b/ldso/ldso/x86_64/elfinterp.c @@ -158,7 +158,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, int symtab_index; char *symname; struct elf_resolve *tls_tpnt = 0; - ElfW(Sym) *sym; + struct symbol_ref sym_ref; ElfW(Addr) *reloc_addr; ElfW(Addr) symbol_addr; #if defined (__SUPPORT_LD_DEBUG__) @@ -168,28 +168,30 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, reloc_addr = (ElfW(Addr)*)(tpnt->loadaddr + (unsigned long)rpnt->r_offset); reloc_type = ELF_R_TYPE(rpnt->r_info); symtab_index = ELF_R_SYM(rpnt->r_info); - sym = &symtab[symtab_index]; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symbol_addr = 0; - symname = strtab + sym->st_name; + symname = strtab + sym_ref.sym->st_name; if (symtab_index) { symbol_addr = (ElfW(Addr))_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &tls_tpnt); + elf_machine_type_class(reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this * might have been intentional. We should not be linking local * symbols here, so all bases should be covered. */ - if (unlikely(!symbol_addr && (ELF_ST_TYPE(sym->st_info) != STT_TLS) - && (ELF_ST_BIND(sym->st_info) != STB_WEAK))) { + if (unlikely(!symbol_addr && (ELF_ST_TYPE(sym_ref.sym->st_info) != STT_TLS) + && (ELF_ST_BIND(sym_ref.sym->st_info) != STB_WEAK))) { /* This may be non-fatal if called from dlopen. */ return 1; } + tls_tpnt = sym_ref.tpnt; } else { /* Relocs against STN_UNDEF are usually treated as using a * symbol value of zero, and using the module containing the * reloc itself. */ - symbol_addr = sym->st_value; + symbol_addr = sym_ref.sym->st_value; tls_tpnt = tpnt; } @@ -249,13 +251,13 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, if (_dl_debug_move) _dl_dprintf(_dl_debug_file, "\t%s move %d bytes from %x to %x\n", - symname, sym->st_size, + symname, sym_ref.sym->st_size, symbol_addr, reloc_addr); #endif _dl_memcpy((char *)reloc_addr, (char *)symbol_addr, - sym->st_size); + sym_ref.sym->st_size); } else _dl_dprintf(_dl_debug_file, "no symbol_addr to copy !?\n"); break; diff --git a/ldso/ldso/xtensa/elfinterp.c b/ldso/ldso/xtensa/elfinterp.c index 48281913d..8eb600916 100644 --- a/ldso/ldso/xtensa/elfinterp.c +++ b/ldso/ldso/xtensa/elfinterp.c @@ -146,7 +146,7 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, int reloc_type; int symtab_index; char *symname; - Elf32_Sym *sym; + struct symbol_ref sym_ref; Elf32_Addr *reloc_addr; Elf32_Addr symbol_addr; #if defined (__SUPPORT_LD_DEBUG__) @@ -156,14 +156,15 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, reloc_addr = (Elf32_Addr *) (tpnt->loadaddr + rpnt->r_offset); reloc_type = ELF32_R_TYPE (rpnt->r_info); symtab_index = ELF32_R_SYM (rpnt->r_info); - sym = &symtab[symtab_index]; + sym_ref.sym = &symtab[symtab_index]; + sym_ref.tpnt = NULL; symbol_addr = 0; - symname = strtab + sym->st_name; + symname = strtab + sym_ref.sym->st_name; if (symtab_index) { symbol_addr = (Elf32_Addr) _dl_find_hash (symname, scope, tpnt, - elf_machine_type_class (reloc_type), NULL); + elf_machine_type_class (reloc_type), &sym_ref); /* * We want to allow undefined references to weak symbols - this might @@ -171,7 +172,7 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, * here, so all bases should be covered. */ if (unlikely (!symbol_addr && - ELF32_ST_BIND (sym->st_info) != STB_WEAK)) { + ELF32_ST_BIND (sym_ref.sym->st_info) != STB_WEAK)) { _dl_dprintf (2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname); _dl_exit (1); diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 3957e846f..b88bc4819 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -613,6 +613,7 @@ void *dlsym(void *vhandle, const char *name) struct dyn_elf *rpnt; void *ret; struct elf_resolve *tls_tpnt = NULL; + struct symbol_ref sym_ref = { NULL, NULL }; /* Nastiness to support underscore prefixes. */ #ifdef __UCLIBC_UNDERSCORES__ char tmp_buf[80]; @@ -667,13 +668,13 @@ void *dlsym(void *vhandle, const char *name) tpnt = NULL; if (handle == _dl_symbol_tables) tpnt = handle->dyn; /* Only search RTLD_GLOBAL objs if global object */ - ret = _dl_find_hash(name2, handle, NULL, 0, &tls_tpnt); + ret = _dl_find_hash(name2, handle, tpnt, 0, &sym_ref); #if defined(USE_TLS) && USE_TLS && defined SHARED - if (tls_tpnt) { + if (sym_ref.tpnt) { /* The found symbol is a thread-local storage variable. Return the address for to the current thread. */ - ret = _dl_tls_symaddr ((struct link_map *)tls_tpnt, (Elf32_Addr)ret); + ret = _dl_tls_symaddr ((struct link_map *)sym_ref.tpnt, (Elf32_Addr)ret); } #endif -- cgit v1.2.3 From 8fb5b1cffd576ba9cec8c42df028e8afd6933dcd Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Wed, 12 Jan 2011 12:07:39 +0100 Subject: ldso: get rid of _dl_lookup_hash Now _dl_find_hash and _dl_lookup_hash are exactly the same, we can get rid of the _dl_lookup_hash, reverting the _dl_find_hash from a wrapper of _dl_lookup_hash to its original role. Signed-off-by: Carmelo Amoroso --- ldso/include/dl-hash.h | 8 +------- ldso/ldso/bfin/elfinterp.c | 6 +++--- ldso/ldso/dl-hash.c | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h index d1f9accc5..d8b3e3ef4 100644 --- a/ldso/include/dl-hash.h +++ b/ldso/include/dl-hash.h @@ -142,15 +142,9 @@ extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname, DL_LOADADDR_TYPE loadaddr, unsigned long * dynamic_info, unsigned long dynamic_addr, unsigned long dynamic_size); -extern char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, +extern char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *mytpnt, int type_class, struct symbol_ref *symbol); -static __always_inline char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, - struct elf_resolve *mytpnt, int type_class, - struct symbol_ref *symbol) -{ - return _dl_lookup_hash(name, rpnt, mytpnt, type_class, symbol); -} extern int _dl_linux_dynamic_link(void); diff --git a/ldso/ldso/bfin/elfinterp.c b/ldso/ldso/bfin/elfinterp.c index 5accbfc2c..48470d50b 100644 --- a/ldso/ldso/bfin/elfinterp.c +++ b/ldso/ldso/bfin/elfinterp.c @@ -67,9 +67,9 @@ _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) got_entry = (struct funcdesc_value *) DL_RELOC_ADDR(tpnt->loadaddr, this_reloc->r_offset); /* Get the address to be used to fill in the GOT entry. */ - new_addr = _dl_lookup_hash(symname, tpnt->symbol_scope, NULL, 0, &sym_ref); + new_addr = _dl_find_hash(symname, tpnt->symbol_scope, NULL, 0, &sym_ref); if (!new_addr) { - new_addr = _dl_lookup_hash(symname, NULL, NULL, 0, &sym_ref); + new_addr = _dl_find_hash(symname, NULL, NULL, 0, &sym_ref); if (!new_addr) { _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname); @@ -184,7 +184,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, } else { symbol_addr = (unsigned long) - _dl_lookup_hash(symname, scope, NULL, 0, &sym_ref); + _dl_find_hash(symname, scope, NULL, 0, &sym_ref); /* * We want to allow undefined references to weak symbols - this might diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c index 6db81a90c..0454d61bf 100644 --- a/ldso/ldso/dl-hash.c +++ b/ldso/ldso/dl-hash.c @@ -268,7 +268,7 @@ _dl_lookup_sysv_hash(struct elf_resolve *tpnt, ElfW(Sym) *symtab, unsigned long * This function resolves externals, and this is either called when we process * relocations or when we call an entry in the PLT table for the first time. */ -char *_dl_lookup_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *mytpnt, +char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *mytpnt, int type_class, struct symbol_ref *sym_ref) { struct elf_resolve *tpnt = NULL; -- cgit v1.2.3 From 5c02df4f734011cccc65441e5dae2f5c18447f39 Mon Sep 17 00:00:00 2001 From: Will Newton Date: Thu, 20 Jan 2011 15:26:14 +0100 Subject: nptl: fix start_thread() for _STACK_GROWS_UP This patch adds a working implementation of pthread_create for architectures where STACK_GROWS_UP. Signed-off-by: Matt Fleming Signed-off-by: Carmelo Amoroso --- libpthread/nptl/pthread_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c index 63e5588d5..86ff1488b 100644 --- a/libpthread/nptl/pthread_create.c +++ b/libpthread/nptl/pthread_create.c @@ -379,11 +379,11 @@ start_thread (void *arg) /* Mark the memory of the stack as usable to the kernel. We free everything except for the space used for the TCB itself. */ size_t pagesize_m1 = __getpagesize () - 1; -#ifdef _STACK_GROWS_DOWN char *sp = CURRENT_STACK_FRAME; +#ifdef _STACK_GROWS_DOWN size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1; #else -# error "to do" + size_t freesize = ((char *) pd->stackblock - sp) & ~pagesize_m1; #endif assert (freesize < pd->stackblock_size); if (freesize > PTHREAD_STACK_MIN) -- cgit v1.2.3 From 6d5e1c5ee7a3c307251c4be7076982f5a1f1769d Mon Sep 17 00:00:00 2001 From: Will Newton Date: Thu, 20 Jan 2011 15:31:14 +0100 Subject: nptl: Fix __USER_LABEL_PREFIX__ concatenatio The current C macro magic does not correctly concatenate the __USER_LABEL_PREFIX__ string on architectures where it has a non-empty value. We need to use __stringify to get the desired behaviour. Signed-off-by: Will Newton Signed-off-by: Carmelo Amoroso --- libpthread/nptl/pthreadP.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h index c45bd1170..fbac7d08f 100644 --- a/libpthread/nptl/pthreadP.h +++ b/libpthread/nptl/pthreadP.h @@ -274,6 +274,8 @@ __do_cancel (void) #define CANCEL_RESET(oldtype) \ __pthread_disable_asynccancel (oldtype) +#define __LABEL_PREFIX__ __stringify(__USER_LABEL_PREFIX__) + #if !defined NOT_IN_libc /* Same as CANCEL_ASYNC, but for use in libc.so. */ # define LIBC_CANCEL_ASYNC() \ @@ -282,22 +284,22 @@ __do_cancel (void) # define LIBC_CANCEL_RESET(oldtype) \ __libc_disable_asynccancel (oldtype) # define LIBC_CANCEL_HANDLED() \ - __asm__ (".globl " __USER_LABEL_PREFIX__ "__libc_enable_asynccancel"); \ - __asm__ (".globl " __USER_LABEL_PREFIX__ "__libc_disable_asynccancel") + __asm__ (".globl " __LABEL_PREFIX__ "__libc_enable_asynccancel"); \ + __asm__ (".globl " __LABEL_PREFIX__ "__libc_disable_asynccancel") #elif defined NOT_IN_libc && defined IS_IN_libpthread # define LIBC_CANCEL_ASYNC() CANCEL_ASYNC () # define LIBC_CANCEL_RESET(val) CANCEL_RESET (val) # define LIBC_CANCEL_HANDLED() \ - __asm__ (".globl " __USER_LABEL_PREFIX__ "__pthread_enable_asynccancel"); \ - __asm__ (".globl " __USER_LABEL_PREFIX__ "__pthread_disable_asynccancel") + __asm__ (".globl " __LABEL_PREFIX__ "__pthread_enable_asynccancel"); \ + __asm__ (".globl " __LABEL_PREFIX__ "__pthread_disable_asynccancel") #elif defined NOT_IN_libc && defined IS_IN_librt # define LIBC_CANCEL_ASYNC() \ __librt_enable_asynccancel () # define LIBC_CANCEL_RESET(val) \ __librt_disable_asynccancel (val) # define LIBC_CANCEL_HANDLED() \ - __asm__ (".globl " __USER_LABEL_PREFIX__ "__librt_enable_asynccancel"); \ - __asm__ (".globl " __USER_LABEL_PREFIX__ "__librt_disable_asynccancel") + __asm__ (".globl " __LABEL_PREFIX__ "__librt_enable_asynccancel"); \ + __asm__ (".globl " __LABEL_PREFIX__ "__librt_disable_asynccancel") #else # define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ # define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ -- cgit v1.2.3 From 541f53cf24819079242079c5da79d9c5df9a27a8 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Thu, 20 Jan 2011 15:49:47 +0100 Subject: release 0.9.32-rc2 Signed-off-by: Carmelo Amoroso --- Rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules.mak b/Rules.mak index eecdc6426..0d86f9f49 100644 --- a/Rules.mak +++ b/Rules.mak @@ -106,7 +106,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR MAJOR_VERSION := 0 MINOR_VERSION := 9 SUBLEVEL := 32 -EXTRAVERSION :=-rc1-git +EXTRAVERSION :=-rc2 VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL) ABI_VERSION := $(MAJOR_VERSION) ifneq ($(EXTRAVERSION),) -- cgit v1.2.3 From b5dd2e706c1a098b2e8cd8df10500a3dde350efc Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Fri, 21 Jan 2011 08:22:32 +0100 Subject: bump version to 0.9.32-rc2-git Signed-off-by: Carmelo Amoroso --- Rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules.mak b/Rules.mak index 0d86f9f49..8165ccabe 100644 --- a/Rules.mak +++ b/Rules.mak @@ -106,7 +106,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR MAJOR_VERSION := 0 MINOR_VERSION := 9 SUBLEVEL := 32 -EXTRAVERSION :=-rc2 +EXTRAVERSION :=-rc2-git VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL) ABI_VERSION := $(MAJOR_VERSION) ifneq ($(EXTRAVERSION),) -- cgit v1.2.3