summaryrefslogtreecommitdiff
path: root/libc/elf
diff options
context:
space:
mode:
Diffstat (limited to 'libc/elf')
-rw-r--r--libc/elf/Makefile2
-rw-r--r--libc/elf/cache.c8
-rw-r--r--libc/elf/dl-load.c3
-rw-r--r--libc/elf/elf.h9
-rw-r--r--libc/elf/get-dynamic-info.h11
-rwxr-xr-xlibc/elf/sotruss.ksh4
6 files changed, 32 insertions, 5 deletions
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index be9456bf7..41eebcf08 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -336,7 +336,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
$(filter-out $(map-file),$^) $(load-map-file) \
-Wl,-soname=$(rtld-installed-name) \
-Wl,-defsym=_begin=0
- readelf -s $@ \
+ $(READELF) -s $@ \
| $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
# interp.c exists just to get this string into the libraries.
diff --git a/libc/elf/cache.c b/libc/elf/cache.c
index db8b9fa2f..f5ed370e7 100644
--- a/libc/elf/cache.c
+++ b/libc/elf/cache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2003,2005,2006,2007,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -94,6 +94,12 @@ print_entry (const char *lib, int flag, unsigned int osversion,
case FLAG_X8664_LIBX32:
fputs (",x32", stdout);
break;
+ case FLAG_ARM_LIBHF:
+ fputs (",hard-float", stdout);
+ break;
+ case FLAG_AARCH64_LIB64:
+ fputs (",AArch64", stdout);
+ break;
case 0:
break;
default:
diff --git a/libc/elf/dl-load.c b/libc/elf/dl-load.c
index c66e68d8e..0fe664145 100644
--- a/libc/elf/dl-load.c
+++ b/libc/elf/dl-load.c
@@ -1351,7 +1351,8 @@ cannot allocate TLS data structures for initial thread");
&& ((size_t) (c->mapend - c->mapstart + c->mapoff)
>= header->e_phoff + header->e_phnum * sizeof (ElfW(Phdr))))
/* Found the program header in this segment. */
- l->l_phdr = (void *) (c->mapstart + header->e_phoff - c->mapoff);
+ l->l_phdr = (void *) (uintptr_t) (c->mapstart + header->e_phoff
+ - c->mapoff);
if (c->allocend > c->dataend)
{
diff --git a/libc/elf/elf.h b/libc/elf/elf.h
index 1effa0710..b07e6ad93 100644
--- a/libc/elf/elf.h
+++ b/libc/elf/elf.h
@@ -798,6 +798,15 @@ typedef struct
#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */
#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */
#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */
+#define DF_1_NODIRECT 0x00020000 /* Object has no-direct binding. */
+#define DF_1_IGNMULDEF 0x00040000
+#define DF_1_NOKSYMS 0x00080000
+#define DF_1_NOHDR 0x00100000
+#define DF_1_EDITED 0x00200000 /* Object is modified after built. */
+#define DF_1_NORELOC 0x00400000
+#define DF_1_SYMINTPOSE 0x00800000 /* Object has individual interposers. */
+#define DF_1_GLOBAUDIT 0x01000000 /* Global auditin required. */
+#define DF_1_SINGLETON 0x02000000 /* Singleton symbols are used. */
/* Flags for the feature selection in DT_FEATURE_1. */
#define DTF_1_PARINIT 0x00000001
diff --git a/libc/elf/get-dynamic-info.h b/libc/elf/get-dynamic-info.h
index ffac75f63..026f24623 100644
--- a/libc/elf/get-dynamic-info.h
+++ b/libc/elf/get-dynamic-info.h
@@ -151,6 +151,17 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
{
l->l_flags_1 = info[VERSYMIDX (DT_FLAGS_1)]->d_un.d_val;
+ /* Only DT_1_SUPPORTED_MASK bits are supported, and we would like
+ to assert this, but we can't. Users have been setting
+ unsupported DF_1_* flags for a long time and glibc has ignored
+ them. Therefore to avoid breaking existing applications the
+ best we can do is add a warning during debugging with the
+ intent of notifying the user of the problem. */
+ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
+ && l->l_flags_1 & ~DT_1_SUPPORTED_MASK)
+ _dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n",
+ l->l_flags_1 & ~DT_1_SUPPORTED_MASK);
+
if (l->l_flags_1 & DF_1_NOW)
info[DT_BIND_NOW] = info[VERSYMIDX (DT_FLAGS_1)];
}
diff --git a/libc/elf/sotruss.ksh b/libc/elf/sotruss.ksh
index 587ab6898..8390b6c50 100755
--- a/libc/elf/sotruss.ksh
+++ b/libc/elf/sotruss.ksh
@@ -94,14 +94,14 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
do_missing_arg "$1"
fi
shift
- SOTRUSS_FROMLIST="$2"
+ SOTRUSS_FROMLIST="$1"
;;
-T | --t | --to)
if test $# -eq 1; then
do_missing_arg "$1"
fi
shift
- SOTRUSS_TOLIST="$2"
+ SOTRUSS_TOLIST="$1"
;;
-o | --o | --ou | --out | --outp | --outpu | --output)
if test $# -eq 1; then