On 2018-03-09 7:59 PM, Raphael Hertzog wrote:
Thanks for the report, I forwarded it upstream but it seems strange that
hppa is the only architecture with such a problem. Is there something
special about this architecture that could explain this singularity?
Yes. Function pointers on hppa differ from all other architectures.
Firstly, there is a
bit in function pointers that determines whether or not the pointer
points directly to
the function or a function descriptor. The former mode is only used in
a handful of
applications that don't link against shared libraries. Secondly, the
hppa runtime didn't
require that there be an official procedure descriptor for functions
called indirectly.
As a result, there can be multiple function descriptors for any given
function. Thus,
one can't just compare function pointers directly. One has to look into
the function
descriptor and if necessary call into the dynamic linker to resolve the
function's
address in the descriptor. Once the descriptors are resolved, the
pointers from the
descriptors can be compared. The whole process is pretty horrible.
I applied a patch to gcc-8 to fix the "0xdeadbeef" problem. It adds a
check to ensure
that the pointer points to read accessible memory. It also checks that
the address in
the descriptor is read accessible. Will backport to 7 and 6 when I get
a chance.
Regards,
Dave Anglin
--
John David Anglin dave.ang...@bell.net