public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kate at iti dot fi" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access Date: Fri, 26 Mar 2004 15:02:00 -0000 [thread overview] Message-ID: <20040326150154.14743.kate@iti.fi> (raw) I try compile program with following options :powerpc-8xx-eabi-gcc -fverbose-asm -O2 -I../include -meabi -memb -msdata=eabi -Wa,-al -G10000 hello.c -o hello.o The test program is simple one (end of this mail ) The manual clearly states: -msdata=eabi On System V.4 and embedded PowerPC systems, put small initialized const global and static data in the .sdata2 section, which is pointed to by register r2. Put small initialized non-const global and static data in the .sdata section, which is pointed to by register r13. So, the all data unnder 10000 bytes hould put in small data sections and addressed with register relative instructions but this does not happen. I even checked from produced assembly listing that it uses la instruction ( addi %r,0,<immediate>) instead using addi %r,%r2,<immediate> that forms address relative to r2 ( or r13 ) Also storing the valu e i is 52 0028 90000000 stw 0,i@sda21(0) # i instead sww 0,i(2) Also, i can't pass it to linker because it gives relocation truncated to fit: R_PPC_EMB_SDA21 hellos Ithis my be my fault mut least i have not found solution anywhere how to make register relative ( position independent) data to wark. The my main goal is just compile position independent code and data for my open source Katix rtos. I ahave also tried many gcc versions starting from 2.x.x and got no-one working. Kate const char hellos[] = "hello: Hello, world!\n\r"; volatile int i; int _start() { for(;;) { i=my_strlen(hellos); i=my_strlen("hello: Hello, world!\n\r"); } } int my_strlen(char *s) { int i=0; while(*s++) i++; return i; } -- Summary: -msdata=eabi does not produce r2/r13 relative access Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kate at iti dot fi CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: powerpc-8xx-eabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743
next reply other threads:[~2004-03-26 15:02 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-03-26 15:02 kate at iti dot fi [this message] 2004-03-26 15:17 ` [Bug c/14743] " pinskia at gcc dot gnu dot org 2004-03-26 15:19 ` [Bug target/14743] " pinskia at gcc dot gnu dot org 2004-03-26 15:24 ` kate at iti dot fi 2004-11-27 11:46 ` amodra at bigpond dot net dot au
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=20040326150154.14743.kate@iti.fi \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).