On 25 May 2017 at 21:24, dann frazier <[email protected]> wrote:
> On Wed, May 24, 2017 at 03:27:07PM -0700, Ard Biesheuvel wrote:
>> On 24 May 2017 at 13:26, dann frazier <[email protected]> wrote:
>> > v2:
>> > * Replace -no-pie w/ -static for compat with GCC 4.9
>> >
>>
>> For my understanding, could you elaborate on what goes wrong if you
>> omit -static / -no-pie?
>
> Well, nothing... now :) -static/-no-pie was avoiding an issue with GenFw:
>
>    -----------
> "GenFw" -e SEC -o 
> /tmp/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC49/AARCH64/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.efi
>  
> /tmp/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC49/AARCH64/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.dll
> GenFw: ERROR 3000: Invalid
>   WriteSections64():
>   
> /tmp/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC49/AARCH64/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.dll
>   AARCH64 small code model requires identical ELF and PE/COFF section
>   offsets modulo 4 KB.
> [...]
>    -----------
>
> Upon rebase/retest, I found that this was no longer reproducible.
> Bisection shows that the problem went away recently after this commit:
>
> commit 00b00cc57bfe0fca54c904d4dd44a263e243c88b
> Author: Ard Biesheuvel <[email protected]>
> Date:   Fri May 19 11:47:40 2017 +0100
>
>     BaseTools/Scripts: discard .gnu.hash section in GCC builds
>
> -*f*no-pie does still seem to be needed though. Without it, the ARM
> build fails with:
>
>    -----------
> "GenFw" -e DXE_DRIVER -o 
> /tmp/edk2/Build/ArmVirtQemu-ARM/DEBUG_GCC49/ARM/MdeModulePkg/Universal/Network/DpcDxe/DpcDxe/DEBUG/DpcDxe.efi
>  
> /tmp/edk2/Build/ArmVirtQemu-ARM/DEBUG_GCC49/ARM/MdeModulePkg/Universal/Network/DpcDxe/DpcDxe/DEBUG/DpcDxe.dll
> GenFw: ERROR 3000: Invalid
>   
> /tmp/edk2/Build/ArmVirtQemu-ARM/DEBUG_GCC49/ARM/MdeModulePkg/Universal/Network/DpcDxe/DpcDxe/DEBUG/DpcDxe.dll:
>  Bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x5e94 or unsupported 
> symbol type.  For example, absolute and undefined symbols are not supported.
>    -----------
>

Meh. That is actually quite annoying. For AARCH64, we simply haven't
implemented the GOT related ELF relocations in the ELF to PE/COFF
converter, so there we cannot deal with PIC code involving GOT entries
at all. For ARM, the only roadblock appears to be that
__GLOBAL_OFFSET_TABLE__ is emitted as SHN_ABS (which makes no sense at
all given that it points into the image, which makes it relative like
any other symbol reference).

In any case, could you please drop the -static and respin? Thanks.
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to