diff options
author | Domen Kožar <domen@dev.si> | 2020-06-12 07:44:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 07:44:28 (GMT) |
commit | d9c9926f2409794af1c47ae1d987ad52d0172212 (patch) | |
tree | f0f41291fe468146b7813b1da858c209b64e0099 /src | |
parent | d6b2a72d9ec3bdfde4b1aacdada823ce388968bb (diff) | |
parent | e522b14edc0ef742106771176f13c9a0b78818ca (diff) | |
download | patchelf-d9c9926f2409794af1c47ae1d987ad52d0172212.zip patchelf-d9c9926f2409794af1c47ae1d987ad52d0172212.tar.gz patchelf-d9c9926f2409794af1c47ae1d987ad52d0172212.tar.bz2 |
Merge pull request #209 from AaronDMarasco/libasan
Add libasan build option and test print-needed
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/patchelf.cc | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 7170cf3..b9aee08 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,9 @@ AM_CXXFLAGS = -Wall -std=c++11 -D_FILE_OFFSET_BITS=64 +if WITH_ASAN +AM_CXXFLAGS += -fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1 +endif + bin_PROGRAMS = patchelf patchelf_SOURCES = patchelf.cc elf.h diff --git a/src/patchelf.cc b/src/patchelf.cc index 965686a..0d0f369 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -250,7 +250,6 @@ I ElfFile<ElfFileParamNames>::rdi(I i) return r; } - /* Ugly: used to erase DT_RUNPATH when using --force-rpath. */ #define DT_IGNORE 0x00726e67 @@ -737,7 +736,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary() ET_DYN as does LD when linking with pie. If we move PT_PHDR, it has to stay in the first PT_LOAD segment or any subsequent ones if they're continuous in memory due to linux kernel constraints - (see BUGS). Since the end of the file would be after bss, we can't + (see BUGS). Since the end of the file would be after bss, we can't move PHDR there, we therefore choose to leave PT_PHDR where it is but move enough following sections such that we can add the extra PT_LOAD section to it. This PT_LOAD segment ensures the sections at the end of |