[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] ARM64 PE32+ and UEFI support
From: |
Andrei Warkentin |
Subject: |
Re: [Tinycc-devel] ARM64 PE32+ and UEFI support |
Date: |
Wed, 23 Aug 2017 14:12:43 -0400 |
What's the default behavior for MS tools regarding base relocations? Base
relocations are different from object relocs (which is what AFAIK emit-relocs
does), and are an inherent feature of PE COFF.
It will be still enabled by default if you build UEFI images. UEFI images
without base relocs are not valid.
A
> 23 авг. 2017 г., в 12:16, Barath Aron <address@hidden> написал(а):
>
>
>
>> On 08/23/2017 02:57 PM, grischka wrote:
>> Andrei E. Warkentin wrote:
>>> Dear tinycc-devel,
>>>
>>> A few more fixes for your review.
>>>
>>> - support for generating ARM64 PE32+ images
>>> - support for generating X64, ARM64, IA32 (untested) and ARM (untested)
>>> UEFI images.
>>
>> I don't think we want relocation entries by default in x86/x86-64
>> executables. Maybe you can support -Wl,-no-strip-base-relocs
>
> I would suggest this from ld(1):
>
> -q
> --emit-relocs
> Leave relocation sections and contents in fully linked executables.
> Post link analysis and optimization tools may need this information
> in order to perform correct modifications of executables. This
> results in larger executables.
>
> I'm also interested in this feature.
>
> Regard,
> Áron
>
>
>
>>
>> Also pe32.h and the longish portions with IMAGE_SUBSYSTEM_*/IMAGE_FILE_*
>> produce lots of visual clutter. Maybe for something that changes once
>> in 10 years, we can use just hex numbers as before.
>>
>> Other than that the patch seems to make sense. On which system did
>> you test this?
>>
>> -- gr
>>
>>> https://github.com/andreiw/tinycc/commit/5267c3c291841cb3c3ad1ec88b4ab91a16afc44b
>>>
>>> (PE: clean up characteristcs/subsystem code)
>>> https://github.com/andreiw/tinycc/commit/2df4e01b400211cce90b3d427bf06dbad35bb453
>>>
>>> (PE: fix UEFI image generation)
>>> https://github.com/andreiw/tinycc/commit/5cf413024d4a4a163cbf3a4f4329d75f3dd640f9
>>>
>>> (PE: experimental ARM64 support)
>>>
>>>
>>> The UEFI stuff was tested by building the following simple app (you need
>>> Tiano edk2 for the headers).
>>>
>>> $ ./x86_64-win32-tcc -I ../edk2/MdePkg/Include/ -I
>>> ../edk2/MdePkg/Include/X64/ ../efitest.c -Wl,-subsystem=efiapp -nostdlib
>>> -o ../efitest.x64.efi -v
>>>
>>> $ ./arm64-win32-tcc -I ../edk2/MdePkg/Include/ -I
>>> ../edk2/MdePkg/Include/AArch64/ ../efitest.c -Wl,-subsystem=efiapp
>>> -nostdlib -o ../efitest.aa64.efi
>>>
>>> -->
>>> #include <Uefi.h>
>>>
>>> CHAR16 *gHello = L"Hello from a TinyCC compiled UEFI binary!\r\n";
>>>
>>> EFI_STATUS EFIAPI
>>> _start(EFI_HANDLE Handle,
>>> EFI_SYSTEM_TABLE *SystemTable)
>>> {
>>> CHAR16 *StackString = L"String pointer on the stack\r\n";
>>> SystemTable->ConOut->OutputString(SystemTable->ConOut, StackString);
>>> SystemTable->ConOut->OutputString(SystemTable->ConOut, gHello);
>>> return EFI_SUCCESS;
>>> }
>>> -->
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Tinycc-devel mailing list
>>> address@hidden
>>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>>
>>
>> _______________________________________________
>> Tinycc-devel mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel