diff options
author | Matt Turner <mattst88@gmail.com> | 2016-12-14 16:04:26 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2016-12-14 16:19:48 -0800 |
commit | 838ebbcf92352217ea7ed16e0894ea585a357f88 (patch) | |
tree | f4a4a1217c84210da3f785e0836d23ab10e5896e /Makefile | |
parent | 9728a8bdc1d882acf534df6a86dbb435146a5ca8 (diff) |
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
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |