public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access
@ 2004-03-26 15:02 kate at iti dot fi
  2004-03-26 15:17 ` [Bug c/14743] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: kate at iti dot fi @ 2004-03-26 15:02 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/14743] -msdata=eabi does not produce r2/r13 relative access
  2004-03-26 15:02 [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access kate at iti dot fi
@ 2004-03-26 15:17 ` pinskia at gcc dot gnu dot org
  2004-03-26 15:19 ` [Bug target/14743] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-26 15:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-26 15:17 -------
*** Bug 14745 has been marked as a duplicate of this bug. ***

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/14743] -msdata=eabi does not produce r2/r13 relative access
  2004-03-26 15:02 [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access kate at iti dot fi
  2004-03-26 15:17 ` [Bug c/14743] " pinskia at gcc dot gnu dot org
@ 2004-03-26 15:19 ` 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
  3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-26 15:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-26 15:19 -------
Did you try with -fPIC or -fpic as I think PPC eabi is non-pic by default?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
            Summary|-msdata=eabi does not       |-msdata=eabi does not
                   |produce r2/r13 relative     |produce r2/r13 relative
                   |access                      |access


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/14743] -msdata=eabi does not produce r2/r13 relative access
  2004-03-26 15:02 [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access kate at iti dot fi
  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
  3 siblings, 0 replies; 7+ messages in thread
From: kate at iti dot fi @ 2004-03-26 15:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kate at iti dot fi  2004-03-26 15:24 -------
Subject: Re:  -msdata=eabi does not produce r2/r13 relative
 access

pinskia at gcc dot gnu dot org wrote:

>------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-26 15:19 -------
>Did you try with -fPIC or -fpic as I think PPC eabi is non-pic by default?
>
>  
>
Yes i did. The -fpic does not produce position independent data access, 
only position
independent code section. All data access including acces to cons data 
is still
position dependnet. For some reason compiler also says that -fpic and
-msdata=eabi are incompatible but i don't understand why.

Ty be truly position independent, allow loading to any address in non mmu
processor memory, both data and program should be position independent 
and so data should be also
register relative as descripted for -msdata=eabi.

Kate


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/14743] -msdata=eabi does not produce r2/r13 relative access
  2004-03-26 15:02 [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access kate at iti dot fi
                   ` (2 preceding siblings ...)
  2004-03-26 15:24 ` kate at iti dot fi
@ 2004-11-27 11:46 ` amodra at bigpond dot net dot au
  3 siblings, 0 replies; 7+ messages in thread
From: amodra at bigpond dot net dot au @ 2004-11-27 11:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at bigpond dot net dot au  2004-11-27 11:46 -------
I'm not so sure this is a valid complaint.  There are other thing we don't put
into .sdata2, for example function addresses (see pr16343).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/14743] -msdata=eabi does not produce r2/r13 relative access
       [not found] <bug-14743-4@http.gcc.gnu.org/bugzilla/>
@ 2012-01-11 12:26 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-11 12:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-11 12:26:36 UTC ---
.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/14743] -msdata=eabi does not produce r2/r13 relative access
       [not found] <bug-14743-8218@http.gcc.gnu.org/bugzilla/>
@ 2008-02-01 13:11 ` manu at gcc dot gnu dot org
  0 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-01 13:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from manu at gcc dot gnu dot org  2008-02-01 13:10 -------
Reported almost 4 years ago, never confirmed. Is this still valid?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14743


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-01-11 12:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-26 15:02 [Bug c/14743] New: -msdata=eabi does not produce r2/r13 relative access kate at iti dot fi
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
     [not found] <bug-14743-8218@http.gcc.gnu.org/bugzilla/>
2008-02-01 13:11 ` manu at gcc dot gnu dot org
     [not found] <bug-14743-4@http.gcc.gnu.org/bugzilla/>
2012-01-11 12:26 ` rguenth at gcc dot gnu.org

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).