Linux MIPS Architecture development
 help / color / mirror / Atom feed
* ELF/Modutils problem
@ 2000-09-20  0:03 Brady Brown
  2000-09-20  0:24 ` Keith Owens
  0 siblings, 1 reply; 9+ messages in thread
From: Brady Brown @ 2000-09-20  0:03 UTC (permalink / raw)
  To: SGI news group

I'm having trouble getting modutils 2.3.10 to work on a little endian
MIPS box running a 2.4.0-test3 kernel. I am cross compiling the kernel
and modules on an i386 using egcs1.0.3a-2 and binutils2.8.1-1. It
appears that the symbol table format in the ELF file created by
mipsel-linux-gcc during a module build is incorrect.

As I read the ELF 1.1 spec - all symbols with STB_LOCAL bindings should
precede all other symbols (weak and global) in the symbol table. Then
the symbol table section's sh_info section header member holds the
symbol table index for the first non-local symbol (and thus can then be
used to determine the number of local symbols). Using the readelf
utility on a generated module shows that the local symbols are not
grouped together before all other symbols but are intermixed though out
the symbol table, and the sh_info field in the header is not set to the
first non-local symbol index.

When insmod runs it malloc's memory equal to the sh_info field and then
begins to populate the local symbols into it. Because of the bad symbol
ordering and incorrect value in sh_info, the malloc'd memory is far to
small to hold all of the local symbols so memory gets blasted and the
module fails to load correctly.

As a side test I tried to incrementally link the module.o file using
mipsel-linux-ld -r module.o -o module. Viewing the ELF output from this
stage showed a correct symbol ordering and sh_info field so it appears
that the linker is generating the correct format for the symbol table
(problem with gcc only?). Has this problem been addressed/resolved? Any
suggestions?

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

end of thread, other threads:[~2000-09-27 23:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-20  0:03 ELF/Modutils problem Brady Brown
2000-09-20  0:24 ` Keith Owens
2000-09-21 13:36   ` Ralf Baechle
2000-09-22  9:57     ` Keith Owens
2000-09-22 13:31       ` Ralf Baechle
2000-09-22 15:23         ` Brady Brown
2000-09-23 21:06           ` Ralf Baechle
2000-09-23 22:03             ` Ulf Carlsson
2000-09-27 10:34               ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox