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(-) --- tcc-doc.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tcc-doc.texi') diff --git a/tcc-doc.texi b/tcc-doc.texi index db1d28f..a1c6761 100644 --- a/tcc-doc.texi +++ b/tcc-doc.texi @@ -307,6 +307,10 @@ Generate an object file combining all input files. @item -Wl,-rpath=path Put custom search path for dynamic libraries into executable. +@item -Wl,--enable-new-dtags +When putting a custom search path for dynamic libraries into the executable, +create the new ELF dynamic tag DT_RUNPATH instead of the old legacy DT_RPATH. + @item -Wl,--oformat=fmt Use @var{fmt} as output format. The supported output formats are: @table @code -- cgit v1.3.1