This is the mail archive of the
mailing list for the GCC project.
sh-unknown-linux-gnu and shared library
- To: gcc at gcc dot gnu dot org
- Subject: sh-unknown-linux-gnu and shared library
- From: NIIBE Yutaka <gniibe at m17n dot org>
- Date: Tue, 2 Oct 2001 13:27:08 +0900 (JST)
- Cc: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Cc: rodrigc at gcc dot gnu dot org, aoliva at redhat dot com, amylaar at redhat dot com
- References: <200110010956.f919u2P22850@mule.m17n.org>
NIIBE Yutaka wrote:
> We needed small changes to GCC, I'll send patches to gcc-patches.
> They are three things:
> Support of no fdiv for integer division
> Support of specific targets (sh3, sh4, sh3eb, and sh4eb)
I've sent the patches for those two.
> Hide some libgcc functions to avoid unexpected register clobber
I think that Kaz will send the patch for this. Before that, I'd like
to explain the problem.
With the call through PLT (Procedure Linkage Table),
(unexpected) register(s) will be clobbered.
There're two cases, one is (non-PIC) executable, and another is (PIC)
Case 1: Executable
Suppose an executable is linked to a shared library which exports a
libgcc function. At link time, PLT will be generated and the call to
that libgcc function will become the one through PLT.
Case 2: Shared library
Normal pc-relative call has no problem, because GCC knows the
There're cases of call of libgcc functions, using the symbol reference
through GOT (Global Offset Table) which goes through PLT. Like this:
<<CALL of __udivsi3>>
The address of PLT entry of __udivsi3
opecode of PLT
Offset of __udivsi3
Such a call doesn't expect PLT clobbers some registers.