File tree Expand file tree Collapse file tree 5 files changed +15
-2
lines changed
Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 2424AC_DEFINE_UNQUOTED ( PAGESIZE , ${PAGESIZE} )
2525AC_MSG_RESULT ( [ Setting page size to ${PAGESIZE}] )
2626
27+ AC_ARG_WITH ( [ asan] ,
28+ AS_HELP_STRING ( [ --with-asan] , [ Link with libasan] )
29+ )
30+ AM_CONDITIONAL([ WITH_ASAN] , [ test x"$with_asan" = xyes] )
31+
2732AC_CONFIG_FILES ( [ Makefile src/Makefile tests/Makefile patchelf.spec] )
2833AC_OUTPUT
Original file line number Diff line number Diff line change 11AM_CXXFLAGS = -Wall -std=c++11 -D_FILE_OFFSET_BITS=64
22
3+ if WITH_ASAN
4+ AM_CXXFLAGS += -fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1
5+ endif
6+
37bin_PROGRAMS = patchelf
48
59patchelf_SOURCES = patchelf.cc elf.h
Original file line number Diff line number Diff line change @@ -250,7 +250,6 @@ I ElfFile<ElfFileParamNames>::rdi(I i)
250250 return r;
251251}
252252
253-
254253/* Ugly: used to erase DT_RUNPATH when using --force-rpath. */
255254#define DT_IGNORE 0x00726e67
256255
@@ -737,7 +736,7 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
737736 ET_DYN as does LD when linking with pie. If we move PT_PHDR, it
738737 has to stay in the first PT_LOAD segment or any subsequent ones
739738 if they're continuous in memory due to linux kernel constraints
740- (see BUGS). Since the end of the file would be after bss, we can't
739+ (see BUGS). Since the end of the file would be after bss, we can't
741740 move PHDR there, we therefore choose to leave PT_PHDR where it is but
742741 move enough following sections such that we can add the extra PT_LOAD
743742 section to it. This PT_LOAD segment ensures the sections at the end of
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ src_TESTS = \
2323 set-interpreter-long.sh set-rpath.sh no-rpath.sh big-dynstr.sh \
2424 set-rpath-library.sh soname.sh shrink-rpath-with-allowed-prefixes.sh \
2525 force-rpath.sh \
26+ plain-needed.sh \
2627 output-flag.sh
2728
2829build_TESTS = \
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+ echo " Confirming main requires libfoo"
4+ ../src/patchelf --print-needed main | grep -q libfoo.so
You can’t perform that action at this time.
0 commit comments