aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorSteffen Nurpmeso <steffen@sdaoden.eu>2017-02-16 15:49:02 +0100
committergrischka <grischka>2017-02-18 09:54:41 +0100
commitf34b1feaca557cd9da198610b67d4328fb0c7a84 (patch)
treeaa74b09d8ff65b8b8429d149703f11abf4a8bb8f /tccelf.c
parent096125d963400951e0f160ced86416ef8c9c98b0 (diff)
downloadtinycc-f34b1feaca557cd9da198610b67d4328fb0c7a84.tar.gz
tinycc-f34b1feaca557cd9da198610b67d4328fb0c7a84.tar.bz2
-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(-)
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tccelf.c b/tccelf.c
index ec92bdb..cc21325 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1968,7 +1968,8 @@ static int elf_output_file(TCCState *s1, const char *filename)
}
if (s1->rpath)
- put_dt(dynamic, DT_RPATH, put_elf_str(dynstr, s1->rpath));
+ put_dt(dynamic, s1->enable_new_dtags ? DT_RUNPATH : DT_RPATH,
+ put_elf_str(dynstr, s1->rpath));
/* XXX: currently, since we do not handle PIC code, we
must relocate the readonly segments */