From: Russell King <rmk@ecs.soton.ac.uk>
To: egcs@cygnus.com
Subject: ARM Linux PIC implementation
Date: Tue, 02 Dec 1997 22:54:00 -0000 [thread overview]
Message-ID: <199712022300.XAA00810@raistlin.armlinux.org> (raw)
Hi!
I'm working on GCC 2.7.2.2 trying to get an ARM PIC implementation going for
ARM/ELF. I've managed to get some areas working, but unfortunately not others...
Currently, I have the following two problems:
1. I need GCC to be able to output into the per-function constant pool
an expression such as:
.word _GLOBAL_OFFSET_TABLE_ - L2 - 8
This is not supported by the gcc 2.7.2.2 decode_rtx_const in varasm.c
The RTX code that I'll be looking to call force_const_mem with is
along the following lines:
(const (minus (minus (symbol ref "_GLOBAL_OFFSET_TABLE_)
(code label "L2"))
(const_int 8))
2. For certain data types, I can't modify the GCC RTL to add in the PIC
GOT register, eg
extern int wibble;
static char err_1[16][16] = { "Hello", "World" };
static char *err_2[16] = {"Hello", "World" };
char *p1, *p2;
int foo (int c)
{
wibble = c + c << 1;
p1 = err_1[c];
p2 = err_2[c];
}
The RTL looks good, except for the `p2 = err_2[c]' expression,
and at no point do I see any call to the `movsi' op to indicate this -
the only reference I see is a reference to LC4, the constant pool label
which contains the `err_2' base address.
The RTL generated by GCC is exactly the same as if it was not generating
PIC therefore. Is there somewhere else that I should be looking to add
PIC functions?
I have added code for LEGITIMIZE_ADDRESS, LEGITIMATE_PIC_OPERAND_P,
FINALIZE_PIC, and added a new function to output a PIC address constant
(similar to output_addr_const.
Any suggestions that you have will be appreciated. BTW, I'm not subscribed
to this mailing list, so if you could reply this mail please.
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@ecs.soton.ac.uk --- ---
| | | | http://www.arm.uk.linux.org/~rmk/home.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |
reply other threads:[~1997-12-02 22:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199712022300.XAA00810@raistlin.armlinux.org \
--to=rmk@ecs.soton.ac.uk \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).