This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: 8bit and 16bit relocations in gold
- From: "Cary Coutant" <ccoutant at google dot com>
- To: "H. Peter Anvin" <hpa at zytor dot com>
- Cc: "Andi Kleen" <andi at firstfloor dot org>, iant at google dot com, binutils at sourceware dot org
- Date: Mon, 28 Apr 2008 11:05:29 -0700
- Subject: Re: 8bit and 16bit relocations in gold
- References: <20080426220401.GA17085@basil.nowhere.org> <4813A7F2.4000201@zytor.com>
> > First the crash happen really in the real mode code which has 8 and 16bit
> > relocations (arch/x86/boot/* in a modern linux kernel tree). This is
> > generated from a custom linker script (arch/x86/boot/setup.ld)
Looks like a couple of cut-n-paste typos (probably mine) in i386.cc.
This patch ought to fix this problem; I'll get it tested and work up a
real patch later today...
-cary
Index: i386.cc
===================================================================
RCS file: /cvs/src/src/gold/i386.cc,v
retrieving revision 1.72
diff -u -p -r1.72 i386.cc
--- i386.cc 19 Apr 2008 18:30:58 -0000 1.72
+++ i386.cc 28 Apr 2008 18:01:40 -0000
@@ -1663,7 +1663,7 @@ Target_i386::Relocate::relocate(const Re
if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC)
ref_flags |= Symbol::FUNCTION_CALL;
if (should_apply_static_reloc(gsym, ref_flags, false))
- Relocate_functions<32, false>::pcrel32(view, object,
psymval, address);
+ Relocate_functions<32, false>::pcrel16(view, object,
psymval, address);
}
break;
@@ -1678,7 +1678,7 @@ Target_i386::Relocate::relocate(const Re
if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC)
ref_flags |= Symbol::FUNCTION_CALL;
if (should_apply_static_reloc(gsym, ref_flags, false))
- Relocate_functions<32, false>::pcrel32(view, object,
psymval, address);
+ Relocate_functions<32, false>::pcrel8(view, object,
psymval, address);
}
break;