From 30035d67728a846fa39749cd162afd278ac654c4 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 11 Apr 2022 11:28:08 +0200 Subject: scripts: Add glibcelf.py module Hopefully, this will lead to tests that are easier to maintain. The current approach of parsing readelf -W output using regular expressions is not necessarily easier than parsing the ELF data directly. This module is still somewhat incomplete (e.g., coverage of relocation types and versioning information is missing), but it is sufficient to perform basic symbol analysis or program header analysis. The EM_* mapping for architecture-specific constant classes (e.g., SttX86_64) is not yet implemented. The classes are defined for the benefit of elf/tst-glibcelf.py. Reviewed-by: Siddhesh Poyarekar --- elf/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'elf/Makefile') diff --git a/elf/Makefile b/elf/Makefile index d30d0ee..3d79f40 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1115,6 +1115,13 @@ tests-special += $(objpfx)check-abi-ld.out update-abi: update-abi-ld update-all-abi: update-all-abi-ld +tests-special += $(objpfx)tst-glibcelf.out +$(objpfx)tst-glibcelf.out: tst-glibcelf.py elf.h $(..)/scripts/glibcelf.py \ + $(..)/scripts/glibcextract.py + PYTHONPATH=$(..)scripts $(PYTHON) tst-glibcelf.py \ + --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" \ + < /dev/null > $@ 2>&1; $(evaluate-test) + # The test requires shared _and_ PIE because the executable # unit test driver must be able to link with the shared object # that is going to eventually go into an installed DSO. -- cgit v1.1