This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: i386 and "R_386_16 relocation against SEC_MERGE section"
- From: Etienne Lorrain <etienne_lorrain at yahoo dot fr>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 9 May 2002 21:55:55 +0200 (CEST)
- Subject: Re: i386 and "R_386_16 relocation against SEC_MERGE section"
--- Alan Modra <amodra@bigpond.net.au> a écrit :
> On Tue, May 07, 2002 at 11:00:36AM +0200, Etienne Lorrain wrote:
> > ld: main.o(.text.menu+0x887): R_386_16 relocation against SEC_MERGE
> > section
> This goes a bit overboard and fixes pcrel relocs to SEC_MERGE sections
> as well. We're hardly going to branch in a SEC_MERGE section, but I
> figured that if I'm supporting more than R_386_32 I might as well do
> them all. The overflow checking is quite possibly wrong; If
> somebody wants to analyse and correct, please go ahead!
It is better, but the overflow checking:
/home/etienne/projet/toolchain/bin/ld boot.o user.o debug.o malloc.o
library.o disk.o util.o main.o gzlib.o fs.o vmlinuz.o mouse.o -nostdlib
-Tboot.lnk -Map=boot.map --undefined=__ERROR --sort-common --cref
--warn-section-align --no-check-sections --gc-sections -o boot.elf
main.o: In function `menu':
main.o(.text.menu+0x8f9): relocation truncated to fit: R_386_16
.rodata.str1.1
main.o(.text.menu+0x90d): relocation truncated to fit: R_386_16
.rodata.str1.1
main.o(.text.menu+0x975): relocation truncated to fit: R_386_16
.rodata.str1.1
main.o(.text.menu+0xb05): relocation truncated to fit: R_386_16
.rodata.str1.1
fs.o: In function `tst_elem':
fs.o(.extra_tst_elem+0x142): relocation truncated to fit: R_386_16
.rodata.str1.1
vmlinuz.o: In function `linux_set_params':
vmlinuz.o(.extra_linux_set_params+0x883): relocation truncated to fit:
R_386_16
.rodata.str1.1
vmlinuz.o(.extra_linux_set_params+0x89a): relocation truncated to fit:
R_386_16
.rodata.str1.1
make: *** [boot.elf] Error 1
--------------------
That is my current (development) version of Gujin, but not yet released.
If you need it, I can send it by private E-mail, but I acheive the same
thing with Gujin-0.6, with two or three modifs.
Get gujin-0.6.tar.gz and e2fsprogs-1.25.tar.gz and your version
of binutils like binutils-020505.tar.gz (name of file has to be
the name of the directory created) in a directory, do
tar -xf gujin-0.6.tar.gz
cd gujin
edit boot.ld and remove line:
/* NOCROSSREFS (.extra_text .text_extra); */
add the lines just after .stabstr (NOLOAD):
.ld-2.12.bug_please_ignore_warning (NOLOAD) : {
*(.rel*)
}
Then just type:
make toolchain
I have to rename file
../toolchain/bin/i686-pc-linux-gnu-as to ../toolchain/bin/as
make dep boot.exe
I get:
util.o: In function `FAT_treat_directory':
util.o(.extra_FAT_treat_directory+0x3d1): relocation truncated to fit:
R_386_16
.rodata.str1.1
vmlinuz.o: In function `menu_load_system':
vmlinuz.o(.extra_menu_load_system+0x10ee): relocation truncated to fit:
R_386_16 .rodata.str1.1
vmlinuz.o(.extra_menu_load_system+0x1102): relocation truncated to fit:
R_386_16 .rodata.str1.1
You can type "make util.s", or you have the util.lis and boot.map
created.
The patch of boot.ld:
[etienne@localhost projet]$ diff -ur gujin gujin-0.6-patched
diff -ur gujin/boot.ld gujin-0.6-patched/boot.ld
--- gujin/boot.ld Thu Feb 7 19:00:03 2002
+++ gujin-0.6-patched/boot.ld Thu May 9 20:51:47 2002
@@ -143,11 +143,14 @@
.stabstr (NOLOAD) : {
*(.stabstr)
}
+ .ld-2.12.bug_please_ignore_warning (NOLOAD) : {
+ *(.rel*)
+ }
}
#if SETUP & EXTRA_SEGMENT
NOCROSSREFS (.text .extra);
-NOCROSSREFS (.extra_text .text_extra);
+/* NOCROSSREFS (.extra_text .text_extra); */
EXTERN (extraseg_never_call_address_zero); /* or KEEP() it */
#ifdef MALLOC_IN_EXTRASEG
[etienne@localhost projet]$
Thanks for your help,
Etienne.
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com