public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36047]  New: -pg does not work on large binaries and m68k
@ 2008-04-25 15:05 gcc at breakpoint dot cc
  2008-07-24 19:49 ` [Bug target/36047] " gcc at breakpoint dot cc
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gcc at breakpoint dot cc @ 2008-04-25 15:05 UTC (permalink / raw)
  To: gcc-bugs

bigeasy@ayoka:~/cc$ echo 'int main(void) { return 0; }' > file.c
bigeasy@ayoka:~/cc$ m68k-linux-gnu-gcc -o file file.c -static -pg
/tmp/ccw33VYP.o: In function `main':
file.c:(.text+0x6): relocation truncated to fit: R_68K_PC16 against `.data'
collect2: ld returned 1 exit status

It works fine with a small binary (without -static).
I don't really know what the label is used for. I patched my gcc with:
|--- a/gcc/config/m68k/linux.h
|+++ b/gcc/config/m68k/linux.h
|@@ -143,7 +143,6 @@ along with GCC; see the file COPYING3.
| #undef FUNCTION_PROFILER
| #define FUNCTION_PROFILER(FILE, LABELNO) \
| {                                                                 \
|-  asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO));            \
|   if (flag_pic)                                                           \
|     fprintf (FILE, "\tbsr.l _mcount@PLTPC\n");                            \
|   else                                                                    \
|--- a/gcc/config/m68k/m68k.h
|+++ b/gcc/config/m68k/m68k.h
|@@ -576,7 +576,7 @@ extern enum reg_class regno_reg_class[];
| #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
|
| #define FUNCTION_PROFILER(FILE, LABELNO)  \
|-  asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))
|+  asm_fprintf (FILE, "\tjsr mcount\n", (LABELNO))
|
| #define EXIT_IGNORE_STACK 1
|

I'm not using glibc's mcount function but my own in which I unwind the stack in
order to obtain caller's address (that's the purpose of the label I guess).

I checked gcc-core-4.3.0.tar.bz2 and the two lea lines are unchanged so the bug
should be still there. 

Now how do we fix this? Removing the label or allowing larger distances?


-- 
           Summary: -pg does not work on large binaries and m68k
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at breakpoint dot cc
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: m68k-uclinux


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


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

end of thread, other threads:[~2009-12-11 15:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-25 15:05 [Bug c/36047] New: -pg does not work on large binaries and m68k gcc at breakpoint dot cc
2008-07-24 19:49 ` [Bug target/36047] " gcc at breakpoint dot cc
2009-03-16 11:36 ` mkuvyrkov at gcc dot gnu dot org
2009-04-22 18:42 ` gcc at breakpoint dot cc
2009-11-04 16:58 ` mkuvyrkov at gcc dot gnu dot org
2009-11-19 10:10 ` mkuvyrkov at gcc dot gnu dot org
2009-12-11 15:32 ` mkuvyrkov at gcc dot gnu dot org
2009-12-11 15:36 ` mkuvyrkov at gcc dot gnu dot 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).