From f34b1feaca557cd9da198610b67d4328fb0c7a84 Mon Sep 17 00:00:00 2001 From: Steffen Nurpmeso Date: Thu, 16 Feb 2017 15:49:02 +0100 Subject: -Wl, --enable-new-dtags for DT_RUNPATH instead of DT_RPATH Today by accident i had to deal with linker problems of some software and found an issue that mentioned DT_RUNPATH, which mentioned that DT_RPATH is legacy and searched for $LD_LIBRARY_PATH, whereas the newer DT_RUNPATH is searched thereafter. Completely unencrypted! Well. For what's it worth, i for one am astonished because of course i want to override $LD_LIBRARY_PATH, but it surely has its merites, smart people came to the conclusion, did they. The attached diff below seems to be sufficient to support DT_RUNPATH instead of DT_RPATH with tcc(1). But i have no insight in what --enable-new-dtags is supposed to change in addition, so i wonder. Ciao! --steffen libtcc.c | 2 ++ tcc-doc.texi | 4 ++++ tcc.h | 1 + tccelf.c | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) --- libtcc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libtcc.c') diff --git a/libtcc.c b/libtcc.c index afcaae7..34e944c 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1377,6 +1377,8 @@ static int tcc_set_linker(TCCState *s, const char *option) ignoring = 1; } else if (link_option(option, "rpath=", &p)) { copy_linker_arg(&s->rpath, p, ':'); + } else if (link_option(option, "enable-new-dtags", &p)) { + s->enable_new_dtags = 1; } else if (link_option(option, "section-alignment=", &p)) { s->section_align = strtoul(p, &end, 16); } else if (link_option(option, "soname=", &p)) { -- cgit v1.3.1