Let ld.so support the DF_TEXTREL flag

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Let ld.so support the DF_TEXTREL flag

Mark Kettenis
The llvm/lld folks discussed implementing DF_TEXTREL and dropping
support for DT_TEXTREL.  We never implemented support for this flag.
It isn't mentioned in the latest "official" ELF standard, but has been
part of drafts since 2000 and has been implemented by most other OSes
(including Solaris).

ok?


Index: libexec/ld.so/resolve.c
===================================================================
RCS file: /cvs/src/libexec/ld.so/resolve.c,v
retrieving revision 1.81
diff -u -p -r1.81 resolve.c
--- libexec/ld.so/resolve.c 24 Jan 2017 07:48:37 -0000 1.81
+++ libexec/ld.so/resolve.c 8 Mar 2018 10:38:59 -0000
@@ -281,6 +281,8 @@ _dl_finalize_object(const char *objname,
  object->dyn.flags |= dynp->d_un.d_val;
  if (dynp->d_un.d_val & DF_SYMBOLIC)
  object->dyn.symbolic = 1;
+ if (dynp->d_un.d_val & DF_TEXTREL)
+ object->dyn.textrel = 1;
  if (dynp->d_un.d_val & DF_ORIGIN)
  object->obj_flags |= DF_1_ORIGIN;
  if (dynp->d_un.d_val & DF_BIND_NOW)