All of lore.kernel.org
 help / color / mirror / Atom feed
* Huge dynamically linked program does not run on mips-linux
@ 2003-10-22  8:11 Atsushi Nemoto
  2003-10-29  7:32 ` Atsushi Nemoto
  0 siblings, 1 reply; 16+ messages in thread
From: Atsushi Nemoto @ 2003-10-22  8:11 UTC (permalink / raw)
  To: linux-mips, binutils

I have a problem that my huge dynamically linked program cause
SIGSEGV or SIGBUS immediately after running from main() on mips-linux.

Digging into this problem, I found that GOT entries are corrupted.

Here are some informations from readelf and objdump:

$ mips-linux-readelf -a myapp
...
Relocation section '.rel.dyn' at offset 0xe3b20 contains 426 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
...
100c47bc  003f7f03 R_MIPS_REL32      004e4990   getrlimit
...
Symbol table '.dynsym' contains 17742 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
...
 16255: 004e4990     0 FUNC    GLOBAL DEFAULT  UND getrlimit
...
Symbol table '.symtab' contains 26849 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
...
  7664: 004e4990     0 FUNC    GLOBAL DEFAULT  UND getrlimit
...

$ mips-linux-objdump -s -j .got myapp
...
Contents of section .got:
...
 100c47b0 100c5cba 00c07c54 100c5c5c 004e4990  ..\...|T..\\.NI.
...


0x004e4990 is "stub" routine to jump into libc's getrlimit.

0x100c47bc must contain 0x004e4990 at run-time, but when the signal
sent the value is 0x009c9320.  It is 0x004e4990+0x004e4990.

The outout from objdump shows 0x004e4990 is already in .got and the
output from readelf shows 0x004e4990 will be added to it by dynamic
loader.  Is my understanding right?

Could anyone tell me why binutils generate such informations?  Or is
this dynamic loader issue?

I'm using binutils 2.14, gcc-3.3.2, glibc-2.2.5.  I tried gcc-3.3.1,
glibc-2.3.2, uClibc-0.9.21, binutils-2.14.90.0.6 and binutils-cvs but
no lock.

My program is huge enough so that older binutils causes "relocation
truncated to fit" error.

The program can work well if statically linked.  Other (relatively
small) dynamically linked programs can work well also.

Thanks.
---
Atsushi Nemoto

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

end of thread, other threads:[~2003-12-01  5:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-22  8:11 Huge dynamically linked program does not run on mips-linux Atsushi Nemoto
2003-10-29  7:32 ` Atsushi Nemoto
2003-10-29 18:14   ` Jun Sun
2003-10-29 18:15     ` Daniel Jacobowitz
2003-10-30  1:53       ` Thiemo Seufer
2003-10-30  2:25         ` Eric Christopher
2003-11-04  5:21           ` Atsushi Nemoto
2003-11-04  8:05             ` Eric Christopher
2003-11-04 11:02               ` Atsushi Nemoto
2003-11-04 17:53                 ` Eric Christopher
2003-11-06 16:54                   ` Atsushi Nemoto
2003-12-01  5:07                     ` Atsushi Nemoto
2003-11-07 16:40                   ` Thiemo Seufer
2003-11-07 20:51                     ` Eric Christopher
2003-10-30 12:54       ` Atsushi Nemoto
2003-11-04 16:17         ` Daniel Jacobowitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.