[syslinux:firmware] This is a giant patch that splits the linker scripts for libraries, modules and executables into the architecture-dependent scripts to facilitate building syslinux modules /executables for i386 and x86_64 environments. The x86_64 linker scripts are derived from the earlier i386 counterparts.

syslinux-bot for chandramouli narayanan mouli at linux.intel.com
Fri Nov 9 09:06:21 PST 2012


Commit-ID:  d8eede3f2a360163235fad222a0190cd7c5bef38
Gitweb:     http://www.syslinux.org/commit/d8eede3f2a360163235fad222a0190cd7c5bef38
Author:     chandramouli narayanan <mouli at linux.intel.com>
AuthorDate: Mon, 25 Jun 2012 12:43:03 -0700
Committer:  chandramouli narayanan <mouli at linux.intel.com>
CommitDate: Mon, 25 Jun 2012 12:43:03 -0700

This is a giant patch that splits the linker scripts for libraries, modules and executables into the architecture-dependent scripts to facilitate building syslinux modules/executables for i386 and x86_64 environments. The x86_64 linker scripts are derived from the earlier i386 counterparts.

Subdirectories i386 and x86_64 hold the respective linker scripts mentioned below.
com32/lib/sylinux.ld
com32/lib/elf.ld
core/syslinux.ld
efi/syslinux.ld
mbr/mbr.ld
memdisk/memdisk.ld

Remanants of the unused old i386-only files, if any, need to be pruned.

---
 com32/lib/{elf32.ld => i386/elf.ld}   |    0
 com32/lib/{elf32.ld => x86_64/elf.ld} |   30 ++++++++++++++++--------------
 core/{ => i386}/syslinux.ld           |    0
 core/{ => x86_64}/syslinux.ld         |    4 ++--
 efi/{ => i386}/syslinux.ld            |    0
 efi/{ => x86_64}/syslinux.ld          |    4 ++--
 mbr/{ => i386}/mbr.ld                 |    0
 mbr/{ => x86_64}/mbr.ld               |    5 ++---
 memdisk/{ => i386}/memdisk.ld         |    0
 memdisk/{ => x86_64}/memdisk.ld       |    4 ++--
 10 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/com32/lib/elf32.ld b/com32/lib/i386/elf.ld
similarity index 100%
copy from com32/lib/elf32.ld
copy to com32/lib/i386/elf.ld
diff --git a/com32/lib/elf32.ld b/com32/lib/x86_64/elf.ld
similarity index 90%
copy from com32/lib/elf32.ld
copy to com32/lib/x86_64/elf.ld
index 158badb..bf9881f 100644
--- a/com32/lib/elf32.ld
+++ b/com32/lib/x86_64/elf.ld
@@ -1,24 +1,25 @@
 /*
  * Linker script for ELF dynamic loaded modules.
+ * This simply mirrors the 32bit linker script with minimal x86_64 changes
  */
 
 /* Script for --shared -z combreloc: shared library, combine & sort relocs */
-OUTPUT_FORMAT("elf32-i386", "elf32-i386",
-	      "elf32-i386")
-OUTPUT_ARCH(i386)
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
   . = 0 + SIZEOF_HEADERS;
   .note.gnu.build-id : { *(.note.gnu.build-id) }
-  .hash           : { *(.hash) }
-  .gnu.hash       : { *(.gnu.hash) }
-  .dynsym         : { *(.dynsym) }
-  .dynstr         : { *(.dynstr) }
+  .hash : { *(.hash) }
+  .gnu.hash  : { *(.gnu.hash) }	
+  .dynsym  : { *(.dynsym) }
+  .dynstr  : { *(.dynstr) }
   .gnu.version    : { *(.gnu.version) }
   .gnu.version_d  : { *(.gnu.version_d) }
   .gnu.version_r  : { *(.gnu.version_r) }
-  .rel.dyn        :
+/* mouli: introduce alignment for various segments */
+  .rel.dyn       :
     {
       *(.rel.init)
       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
@@ -33,7 +34,7 @@ SECTIONS
       *(.rel.got)
       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
     }
-  .rela.dyn       :
+  .rela.dyn  :
     {
       *(.rela.init)
       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
@@ -47,14 +48,14 @@ SECTIONS
       *(.rela.got)
       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
     }
-  .rel.plt        : { *(.rel.plt) }
-  .rela.plt       : { *(.rela.plt) }
+  .rel.plt : { *(.rel.plt); }
+  .rela.plt : { *(.rela.plt) }
   .init           :
   {
     KEEP (*(.init))
   } =0x90909090
-  .plt            : { *(.plt) }
-  .text           :
+  .plt : { *(.plt) }
+  .text :
   {
     *(.text .stub .text.* .gnu.linkonce.t.*)
     KEEP (*(.text.*personality*))
@@ -136,7 +137,8 @@ SECTIONS
       .bss section disappears because there are no input sections.
       FIXME: Why do we need it? When there is no .bss section, we don't
       pad the .data section.  */
-   . = ALIGN(. != 0 ? 32 / 8 : 1);
+   /*. = ALIGN(. != 0 ? 32 / 8 : 1);*/
+   . = ALIGN(. != 0 ? 64 / 8 : 1);
   }
   . = ALIGN(32 / 8);
   . = ALIGN(32 / 8);
diff --git a/core/syslinux.ld b/core/i386/syslinux.ld
similarity index 100%
copy from core/syslinux.ld
copy to core/i386/syslinux.ld
diff --git a/core/syslinux.ld b/core/x86_64/syslinux.ld
similarity index 99%
copy from core/syslinux.ld
copy to core/x86_64/syslinux.ld
index 7b4e012..1057112 100644
--- a/core/syslinux.ld
+++ b/core/x86_64/syslinux.ld
@@ -15,8 +15,8 @@
  * Linker script for the SYSLINUX core
  */
 
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
 EXTERN(_start)
 ENTRY(_start)
 
diff --git a/efi/syslinux.ld b/efi/i386/syslinux.ld
similarity index 100%
copy from efi/syslinux.ld
copy to efi/i386/syslinux.ld
diff --git a/efi/syslinux.ld b/efi/x86_64/syslinux.ld
similarity index 96%
copy from efi/syslinux.ld
copy to efi/x86_64/syslinux.ld
index e027053..3c8c7c3 100644
--- a/efi/syslinux.ld
+++ b/efi/x86_64/syslinux.ld
@@ -15,8 +15,8 @@
  * Linker script for the SYSLINUX core
  */
 
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
 ENTRY(_start)
 
 SECTIONS
diff --git a/mbr/mbr.ld b/mbr/i386/mbr.ld
similarity index 100%
copy from mbr/mbr.ld
copy to mbr/i386/mbr.ld
diff --git a/mbr/mbr.ld b/mbr/x86_64/mbr.ld
similarity index 95%
copy from mbr/mbr.ld
copy to mbr/x86_64/mbr.ld
index d14ba80..ae27d49 100644
--- a/mbr/mbr.ld
+++ b/mbr/x86_64/mbr.ld
@@ -3,9 +3,8 @@
  */
 
 /* Script for -z combreloc: combine and sort reloc sections */
-OUTPUT_FORMAT("elf32-i386", "elf32-i386",
-	      "elf32-i386")
-OUTPUT_ARCH(i386)
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
 EXTERN(_start)
 ENTRY(_start)
 SECTIONS
diff --git a/memdisk/memdisk.ld b/memdisk/i386/memdisk.ld
similarity index 100%
copy from memdisk/memdisk.ld
copy to memdisk/i386/memdisk.ld
diff --git a/memdisk/memdisk.ld b/memdisk/x86_64/memdisk.ld
similarity index 97%
copy from memdisk/memdisk.ld
copy to memdisk/x86_64/memdisk.ld
index 51c3e35..76abb0c 100644
--- a/memdisk/memdisk.ld
+++ b/memdisk/x86_64/memdisk.ld
@@ -15,8 +15,8 @@
  */
 
 /* Script for -z combreloc: combine and sort reloc sections */
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
 EXTERN(_start)
 ENTRY(_start)
 SECTIONS


More information about the Syslinux-commits mailing list