From 838ebbcf92352217ea7ed16e0894ea585a357f88 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 14 Dec 2016 16:04:26 -0800 Subject: Use dl_iterate_phdr() instead of a linker script. According to Mike Frysinger [1] it is not reliable to read ELF sections at runtime, which the previous method involving the linker script was doing. Instead, use dl_iterate_phdr() to find the build id. [1] https://sourceware.org/ml/binutils/2016-12/msg00207.html --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 798da5b..5c4295f 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -LDFLAGS = -Wl,--build-id=sha1 -Wl,--default-script=build-id.lds +LDFLAGS = -Wl,--build-id=sha1 all: build-id so-build-id @@ -33,7 +33,7 @@ shared-build-id.o: build-id.c $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $^ -o $@ libbuild-id.so: shared-build-id.o - $(CC) -Wl,-Bsymbolic $(LDFLAGS) -shared $^ -o $@ + $(CC) $(LDFLAGS) -shared $^ -o $@ clean: rm -f build-id so-build-id libbuild-id.so *.o -- cgit v1.2.3