summaryrefslogtreecommitdiff
path: root/ldso/include
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2011-04-06 15:13:59 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2011-04-06 15:13:59 +0200
commit3b3285b1b7c02d36c74a6ae265fdb02ca991c96b (patch)
tree0f3bf060794323ff690f6f4a86dc903c4570f540 /ldso/include
parent289d19f45d7f8af9a4079938a3426aafdd2674ba (diff)
parent85f4b028d767fc390a7b866d2f58d58be489242d (diff)
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (137 commits) utils/ldd: Check for returned pointer from strrchr not the value it holds cris: add provide arch-specific vfork implementation lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined bump version to 0.9.32-rc3-git release 0.9.32-rc3 memalign: include sys/param.h for MAX arm/bits/atomic.h: Include common/bit/atomic.h for thumb1 wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace add libc_hidden_proto for wcs[n]casecmp_l really fix missing __libc_drand48_data Revert "missing prototype of __libc_drand48_data fixed" missing prototype of __libc_drand48_data fixed time.c, time.h: remove unused hidden strftime/strptime nanosleep.c: remove duplicated libc_hidden_proto ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31 _wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions time.c, wchar.h: remove unused hidden wcsftime str[n]casecmp.c: fix hidden usage remove unused hidden functions frv/memset.S: add missing libc_hidden_def ... Conflicts: ldso/ldso/ldso.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso/include')
-rw-r--r--ldso/include/dl-defs.h2
-rw-r--r--ldso/include/dl-elf.h18
-rw-r--r--ldso/include/dl-syscall.h2
3 files changed, 18 insertions, 4 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h
index cbbaa3cea..d387c0bb9 100644
--- a/ldso/include/dl-defs.h
+++ b/ldso/include/dl-defs.h
@@ -212,7 +212,7 @@ typedef struct {
_dl_find_hash for this reloc TYPE. TPNT is the module in which the
matching SYM was found. */
#ifndef DL_FIND_HASH_VALUE
-# define DL_FIND_HASH_VALUE(TPNT, TYPE, SYM) (DL_RELOC_ADDR ((SYM)->st_value, (TPNT)->loadaddr))
+# define DL_FIND_HASH_VALUE(TPNT, TYPE, SYM) (DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value))
#endif
/* Unmap all previously-mapped segments accumulated in LOADADDR.
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h
index 40c88b9da..908cb63ce 100644
--- a/ldso/include/dl-elf.h
+++ b/ldso/include/dl-elf.h
@@ -200,8 +200,13 @@ unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info
if (dynamic_info[tag]) \
dynamic_info[tag] = (unsigned long) DL_RELOC_ADDR(load_off, dynamic_info[tag]); \
} while (0)
- /* Don't adjust .dynamic unnecessarily. */
- if (load_off != 0) {
+ /* Don't adjust .dynamic unnecessarily. For FDPIC targets,
+ we'd have to walk all the loadsegs to find out if it was
+ actually unnecessary, so skip this optimization. */
+#if !defined __FDPIC__ && !defined __DSBT__
+ if (load_off != 0)
+#endif
+ {
ADJUST_DYN_INFO(DT_HASH, load_off);
ADJUST_DYN_INFO(DT_PLTGOT, load_off);
ADJUST_DYN_INFO(DT_STRTAB, load_off);
@@ -212,6 +217,15 @@ unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info
ADJUST_DYN_INFO(DT_GNU_HASH_IDX, load_off);
#endif
}
+#ifdef __DSBT__
+ /* Get the mapped address of the DSBT base. */
+ ADJUST_DYN_INFO(DT_DSBT_BASE_IDX, load_off);
+
+ /* Initialize loadmap dsbt info. */
+ load_off.map->dsbt_table = dynamic_info[DT_DSBT_BASE_IDX];
+ load_off.map->dsbt_size = dynamic_info[DT_DSBT_SIZE_IDX];
+ load_off.map->dsbt_index = dynamic_info[DT_DSBT_INDEX_IDX];
+#endif
#undef ADJUST_DYN_INFO
return rtld_flags;
}
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 982bc9bf6..da3ac7f6f 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -95,7 +95,7 @@ static __always_inline _syscall0(gid_t, _dl_getegid)
# define __NR_getpid __NR_getxpid
#endif
#define __NR__dl_getpid __NR_getpid
-static __always_inline _syscall0(gid_t, _dl_getpid);
+static __always_inline _syscall0(gid_t, _dl_getpid)
#define __NR__dl_readlink __NR_readlink
static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf,