diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-10-31 13:23:06 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-11-16 15:57:01 +0100 |
commit | 2a764c6ee848dfe92cb2921ed3b14085f15d9e79 (patch) | |
tree | 12d283aab07a5cb66474aff7a388dd585a2d2989 /elf | |
parent | 84df7a4637be8ecb545df3501cc724f3a4d53c46 (diff) | |
download | glibc-2a764c6ee848dfe92cb2921ed3b14085f15d9e79.tar glibc-2a764c6ee848dfe92cb2921ed3b14085f15d9e79.tar.gz glibc-2a764c6ee848dfe92cb2921ed3b14085f15d9e79.tar.bz2 glibc-2a764c6ee848dfe92cb2921ed3b14085f15d9e79.zip |
Enhance _dl_catch_exception to allow disabling exception handling
In some cases, it is necessary to introduce noexcept regions
where raised dynamic loader exceptions (e.g., from lazy binding)
are fatal, despite being nested in a code region with an active
exception handler. This change enhances _dl_catch_exception with
to provide such a capability. The existing function is reused,
so that it is not necessary to introduce yet another function with
a similar purpose.
Change-Id: Iec1bf642ff95a349fdde8040e9baf851ac7b8904
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-error-skeleton.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/elf/dl-error-skeleton.c b/elf/dl-error-skeleton.c index a261af68b6..7caf28f0fd 100644 --- a/elf/dl-error-skeleton.c +++ b/elf/dl-error-skeleton.c @@ -173,6 +173,18 @@ int _dl_catch_exception (struct dl_exception *exception, void (*operate) (void *), void *args) { + /* If exception is NULL, temporarily disable exception handling. + Exceptions during operate (args) are fatal. */ + if (exception == NULL) + { + struct catch *const old = catch_hook; + catch_hook = NULL; + operate (args); + /* If we get here, the operation was successful. */ + catch_hook = old; + return 0; + } + /* We need not handle `receiver' since setting a `catch' is handled before it. */ |