This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

LSDA and PIC compilation, getting the wrong pointer


I'm writing a compiler, using LLVM, that includes exception handling. I
link the results via gcc (convenient option). If I produce static
executables all is well, but my LSDA in a shared module (with PIC), is
incorrect.

I've traced through the libgcc personality function but can't figure out
where I've gone wrong. My LSDA parser seems valid: static builds work,
and I do get the correct number of action records, and the type offsets
seem okay. But the type table is pointing to an invalid location, a
really small address. It's as though it isn't getting its relocated address.

Does this sound like a common problem? Am I missing something simple,
like linker flags? Perhaps an init function of some kind must be called
in the shared library (I define my own init/fini functions).

Platform is GNU/Linux x86_64.
gcc/ld flags: --eh-frame-hdr --build-id --export-dynamic -shared

Sorry if my question isn't strictly gcc related, but I'm not sure where
else somebody might know the answer. I also realize it may be very hard
to assist, since the effect is a combination of my personality code,
LLVM EH generation, the linker, and gcc unwinding.

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]