



libs & vmlinux.lds.s?
by rdaddio on Jun 14, 2013 |
rdaddio
Posts: 18 Joined: Dec 24, 2005 Last seen: Jul 15, 2021 |
||
Hi All -Sorry if this has already been discussed, only been mildly lurking lately. I have a relatively recent tool chain that I built from scratch and a very fresh linux check out from South Pole.
Ran into a couple of issues. 1) My somewhat recent toolchain w/gcc version 4.8.0 20121129 seems to have an issue with libgcc and the _GLOBAL_OFFSET_TABLE_ and the built in div libs. To fix this I had to add udivmod and divmod 'c'(not optimized) files to the kernel libs. Maybe I am missing something like a "shared" flag being set or an updated chain? Surprised about this with a kernel build though... 2) The other oddity I saw was in the linker script '.S'(vmlinux.lds.S)the output format in the script file did not comply with the linker. So I had to change the format from elf32-or32 to elf32-or1k. Once changed my linux image ran fine in the sim so all is well. Sorry if this is redundant or a previously logged issue. |
RE: libs & vmlinux.lds.s?
by stekern on Jun 18, 2013 |
stekern
Posts: 84 Joined: Apr 28, 2009 Last seen: Nov 10, 2016 |
||
It is a known issue, but none that has been more formally addressed than on IRC
(http://juliusbaxter.net/openrisc-irc/%23openrisc.2013-04-04.log.html). The discussion there boils down to libgcc being built with -fPIC, which is necessary now when we have support for dynamic linking and the most likely resolution is to remove the dependency on libgcc in Linux (just like you did), no-one have got around to actually do that in the kernel. If you have something you want to share in that regard, please do so on the mailing lists ;) Also, if you happen to have the baremetal toolchain installed on your machine (or1k-elf-), you can use that to compile the kernel. As for the elf32-or32 to elf32-or1k problem, in the latest toolchain, it was decided to deprecate the or32 name and replace it with or1k. This causes some incompatibilities with the linker scripts (as you noticed). Stefan |
RE: libs & vmlinux.lds.s?
by mpanxiao on Jun 24, 2013 |
mpanxiao
Posts: 4 Joined: Jul 29, 2012 Last seen: Aug 12, 2014 |
||
Sorry, but I couldn't follow "To fix this I had to add udivmod and divmod 'c'(not optimized) files to the kernel libs. "
Can someone help me how to deal with the same error..... |
RE: libs & vmlinux.lds.s?
by mpanxiao on Jun 24, 2013 |
mpanxiao
Posts: 4 Joined: Jul 29, 2012 Last seen: Aug 12, 2014 |
||
BTW, when I use the old version of gcc (4.5) builded form http://openrisc.net/toolchain-build.html#_install_linux_headers, the Linux kernel can be compiled but when simulated using or32-elf-sim, the following error came out :
... ... Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled 90000000.serial: ttyS0 at MMIO 0x90000000 (irq = 2) is a 16550A console [ttyS0] enabled, bootconsole disabled console [ttyS0] enabled, bootconsole disabled libphy: ethoc-mdio: probed NET: Registered protocol family 17 Freeing unused kernel memory: 1416k freed ------------[ cut here ]------------ WARNING: at kernel/softirq.c:160 0xc0014870() Modules linked in: Stack dump [0xc1017e44]: sp + 00: 0x00000009 sp + 04: 0xc000ae40 sp + 08: 0xc02416dc sp + 12: 0x000000a0 ... ... I also couldn't figure it out... Does someone has similar error? Thanks again in advance Xiao |
RE: libs & vmlinux.lds.s?
by aldorof on Dec 23, 2013 |
aldorof
Posts: 1 Joined: Mar 28, 2009 Last seen: Dec 30, 2013 |
||
Since rdaddio didn't reply. This patch works for me with the new
toolchain. At least I'm able to run a or1ksim and the kernel boots.
linux-02-div_libs.patch (3 kb)
|



