From 1d90a5ad5cc54d7664807332c846a23214d159c5 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 25 Feb 2021 20:46:43 +0900 Subject: [PATCH] wip --- output_chunks.cc | 4 +++- test/shared.sh | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/output_chunks.cc b/output_chunks.cc index ad9041e9..d2963aac 100644 --- a/output_chunks.cc +++ b/output_chunks.cc @@ -309,7 +309,9 @@ static std::vector create_dynamic_section() { for (SharedFile *file : out::dsos) define(DT_NEEDED, out::dynstr->find_string(file->soname)); - define(DT_RUNPATH, out::dynstr->find_string(config.rpaths)); + if (!config.rpaths.empty()) + define(DT_RUNPATH, out::dynstr->find_string(config.rpaths)); + define(DT_RELA, out::reldyn->shdr.sh_addr); define(DT_RELASZ, out::reldyn->shdr.sh_size); define(DT_RELAENT, sizeof(ElfRela)); diff --git a/test/shared.sh b/test/shared.sh index 339cac4f..6fd83a34 100755 --- a/test/shared.sh +++ b/test/shared.sh @@ -7,14 +7,28 @@ mkdir -p $t cat < $t/log grep -q '0000000000000000 0 NOTYPE GLOBAL DEFAULT UND fn2' $t/log grep -q '000000000000111c 0 NOTYPE GLOBAL DEFAULT 16 fn1' $t/log +cat <