bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/20062] New: Gold2.26 fail to link Uefi firmware with internal er


From: steven.shi at intel dot com
Subject: [Bug ld/20062] New: Gold2.26 fail to link Uefi firmware with internal error in do_layout, but ld works
Date: Mon, 09 May 2016 05:25:13 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20062

            Bug ID: 20062
           Summary: Gold2.26 fail to link Uefi firmware with internal
                    error in do_layout, but ld works
           Product: binutils
           Version: 2.26
            Status: NEW
          Severity: critical
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: steven.shi at intel dot com
  Target Milestone: ---

Created attachment 9242
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9242&action=edit
Uefi hello example with pre-built libraires to link

Uefi standard (http://www.uefi.org/) firmware
(https://github.com/tianocore/edk2) can build with ld, but cannot build with
gold linker. When link a uefi module, the gold will report internal error in
do_layout as blew.

ld-new: internal error in do_layout, at ../../binutils-2.26/gold/object.cc:1819

Attachment is a Uefi hello example with pre-built libraires, you can direclty
extract it and link them with ld and ld-new:

gold 2.26 will fail as below:
"ld-new" -o Hello.dll -nostdlib -n -q --gc-sections -z common-page-size=0x40
--entry _ModuleEntryPoint -u _ModuleEntryPoint -Map Hello.map -melf_x86_64
--oformat=elf64-x86-64 --start-group  @static_library_files.lst --end-group
--defsym=PECOFF_HEADER_SIZE=0x228 --script=GccBase.lds
ld-new: internal error in do_layout, at ../../binutils-2.26/gold/object.cc:1819


but ld 2.26 will succeed:
"ld" -o Hello.dll -nostdlib -n -q --gc-sections -z common-page-size=0x40
--entry _ModuleEntryPoint -u _ModuleEntryPoint -Map Hello.map -melf_x86_64
--oformat=elf64-x86-64 --start-group  @static_library_files.lst --end-group
--defsym=PECOFF_HEADER_SIZE=0x228 --script=GccBase.lds

BTW, this folder example libraries are abstracted from Uefi Hello module build
as below. If you need, you can build them by yourself
1. Setup EDK2 build environment as steps in the link:
https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC
 
2. git clone https://github.com/tianocore/edk2 (e.g. ~/edk2)
3. cd ~/edk2
4. make -C BaseTools
5. source edksetup.sh
6. build -t GCC49 -a X64 -p AppPkg/AppPkg.dsc -m
AppPkg/Applications/Hello/Hello.inf

After build, you can find all intermediate files in below folder
~/edk2/Build/AppPkg/DEBUG_GCC49/X64/AppPkg/Applications/Hello/Hello

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]