diff options
author | Michael Brown <mcb30@etherboot.org> | 2008-11-18 14:30:37 -0800 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2008-12-05 00:06:27 +0000 |
commit | ce0a0ccf5c2b99be684f13a9418d1556bae5f0ed (patch) | |
tree | 965c86dafc3fbdca8e46ee22b94387242cc0e288 /src/util | |
parent | b0d2c9a4d5b5dd669a845127a37ba08440e2820b (diff) | |
download | ipxe-ce0a0ccf5c2b99be684f13a9418d1556bae5f0ed.tar.gz |
[x86_64] Add support for compilation as an x86_64 binary
Currently the only supported platform for x86_64 is EFI.
Building an EFI64 gPXE requires a version of gcc that supports
__attribute__((ms_abi)). This currently means a development build of
gcc; the feature should be present when gcc 4.4 is released.
In the meantime; you can grab a suitable gcc tree from
git://git.etherboot.org/scm/people/mcb30/gcc/.git
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/efilink.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/util/efilink.c b/src/util/efilink.c index e21f4a90..17b99d29 100644 --- a/src/util/efilink.c +++ b/src/util/efilink.c @@ -56,6 +56,9 @@ static void generate_pe_reloc ( struct pe_relocs **pe_reltab, start_rva = ( rva & ~0xfff ); reloc = ( rva & 0xfff ); switch ( size ) { + case 8: + reloc |= 0xa000; + break; case 4: reloc |= 0x3000; break; @@ -385,13 +388,18 @@ static void process_reloc ( asection *section, arelent *rel, /* Skip absolute symbols; the symbol value won't * change when the object is loaded. */ - } else if ( strcmp ( howto->name, "R_386_32" ) == 0 ) { + } else if ( strcmp ( howto->name, "R_X86_64_64" ) == 0 ) { + /* Generate an 8-byte PE relocation */ + generate_pe_reloc ( pe_reltab, offset, 8 ); + } else if ( ( strcmp ( howto->name, "R_386_32" ) == 0 ) || + ( strcmp ( howto->name, "R_X86_64_32" ) == 0 ) ) { /* Generate a 4-byte PE relocation */ generate_pe_reloc ( pe_reltab, offset, 4 ); } else if ( strcmp ( howto->name, "R_386_16" ) == 0 ) { /* Generate a 2-byte PE relocation */ generate_pe_reloc ( pe_reltab, offset, 2 ); - } else if ( strcmp ( howto->name, "R_386_PC32" ) == 0 ) { + } else if ( ( strcmp ( howto->name, "R_386_PC32" ) == 0 ) || + ( strcmp ( howto->name, "R_X86_64_PC32" ) == 0 ) ) { /* Skip PC-relative relocations; all relative offsets * remain unaltered when the object is loaded. */ |