[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/26626] Provide a hook to customize missing library error handlin
From: |
nickc at redhat dot com |
Subject: |
[Bug ld/26626] Provide a hook to customize missing library error handling |
Date: |
Mon, 12 Oct 2020 11:23:20 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=26626
--- Comment #6 from Nick Clifton <nickc at redhat dot com> ---
Created attachment 12896
--> https://sourceware.org/bugzilla/attachment.cgi?id=12896&action=edit
Proposed patch
Hi Serge,
Here is a prototype of a patch to implement this feature. Would you mind
giving it a try out please ?
I made one change to the suggested protocol for the handler, adding a third
argument when invoking the script. This extra argument is the name of the
file that contains the reference to the missing symbol.
Using the patch and a dummy handler script, I get output like this:
% gcc -c hello.c
% ld hello.o -e 0 --error-handling-script=./handler.sh
missing symbol: hello.o:printf
There is one caveat however. Due to an idiosyncrasy of the pex routines
in the libiberty library, the standard output of the invoked script is
lost. (Well it is redirected to a temporary file which is then deleted).
So in order for the script to produce output that is visible to the user
text has to be written to stderr. So for example the handler.sh script
used above looks like this:
#!/bin/bash
echo "missing symbol: $2:$1" >/dev/stderr
exit 0
I am using the pex routines for portability to non-unix like environments.
Cheers
Nick
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/26626] Provide a hook to customize missing library error handling, sguelton at redhat dot com, 2020/10/07
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/09
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/09
- [Bug ld/26626] Provide a hook to customize missing library error handling,
nickc at redhat dot com <=
- [Bug ld/26626] Provide a hook to customize missing library error handling, sguelton at redhat dot com, 2020/10/12
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/12
- [Bug ld/26626] Provide a hook to customize missing library error handling, sguelton at redhat dot com, 2020/10/12
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/14
- [Bug ld/26626] Provide a hook to customize missing library error handling, sguelton at redhat dot com, 2020/10/14
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/14
- [Bug ld/26626] Provide a hook to customize missing library error handling, sguelton at redhat dot com, 2020/10/14
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/14
- [Bug ld/26626] Provide a hook to customize missing library error handling, cvs-commit at gcc dot gnu.org, 2020/10/16
- [Bug ld/26626] Provide a hook to customize missing library error handling, nickc at redhat dot com, 2020/10/16