summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld.c
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-06-18 03:34:29 +0000
committermdodd <mdodd@FreeBSD.org>2003-06-18 03:34:29 +0000
commitb466954d4e6ffa78f98b19458bcf1560d8d8c776 (patch)
tree7405533ca2f30bdd590fa950b02ca1517b04d559 /libexec/rtld-elf/rtld.c
parent9dcd110789373369f96f2400292de3c7b2d50d6e (diff)
downloadFreeBSD-src-b466954d4e6ffa78f98b19458bcf1560d8d8c776.zip
FreeBSD-src-b466954d4e6ffa78f98b19458bcf1560d8d8c776.tar.gz
- Add support for DT_FLAGS.
- Define various things from the most recent ELF spec.
Diffstat (limited to 'libexec/rtld-elf/rtld.c')
-rw-r--r--libexec/rtld-elf/rtld.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index ab40371..0dea9e6 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -602,6 +602,7 @@ digest_dynamic(Obj_Entry *obj, int early)
break;
case DT_RPATH:
+ case DT_RUNPATH: /* XXX: process separately */
/*
* We have to wait until later to process this, because we
* might not have gotten the address of the string table yet.
@@ -628,6 +629,22 @@ digest_dynamic(Obj_Entry *obj, int early)
((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug;
break;
+ case DT_FLAGS:
+ if (dynp->d_un.d_val & DF_ORIGIN) {
+ obj->origin_path = xmalloc(PATH_MAX);
+ if (rtld_dirname(obj->path, obj->origin_path) == -1)
+ die();
+ }
+ if (dynp->d_un.d_val & DF_SYMBOLIC)
+ obj->symbolic = true;
+ if (dynp->d_un.d_val & DF_TEXTREL)
+ obj->textrel = true;
+ if (dynp->d_un.d_val & DF_BIND_NOW)
+ obj->bind_now = true;
+ if (dynp->d_un.d_val & DF_STATIC_TLS)
+ ;
+ break;
+
default:
if (!early) {
dbg("Ignoring d_tag %ld = %#lx", (long)dynp->d_tag,
@@ -1401,7 +1418,7 @@ relocate_objects(Obj_Entry *first, bool bind_now, Obj_Entry *rtldobj)
if (reloc_plt(obj) == -1)
return -1;
/* Relocate the jump slots if we are doing immediate binding. */
- if (bind_now)
+ if (obj->bind_now || bind_now)
if (reloc_jmpslots(obj) == -1)
return -1;
OpenPOWER on IntegriCloud