Commit graph

382 commits

Author SHA1 Message Date
Nigel Croxon
74bd9b60ba Bump revision to VERSION = 3.0.18 2024-03-22 09:38:35 -04:00
b'Nigel Croxon
52455a5f10 Merge /u/yetist/gnu-efi/ branch dev-master into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/65/
2024-03-22 13:31:15 +00:00
b'Nigel Croxon
8c9ad45504 Merge /u/gmbr3/gnu-efi/ branch header into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/64/
2024-03-22 13:30:40 +00:00
Peter Jones
bd864bda4c Make: make TOPDIR actually work and get rid of unused CDIR
Signed-off-by: Richard Hughes <richard@hughsie.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
2024-03-21 10:20:14 -04:00
Peter Jones
a3772f2e05 make: Make "make clean" use @ and rm -v everywhere
This makes our "make clean" commands show what they've /removed/, rather
than what the shell code that will be run is.

Signed-off-by: Richard Hughes <richard@hughsie.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
2024-03-21 10:19:56 -04:00
Soop
4d4cb5a2bc Make apps link against the local gnuefi and crt objects
Signed-off-by: Richard Hughes <richard@hughsie.com>
2024-03-21 10:19:36 -04:00
Callum Farmer
adbd7ae7b6 Remove 64k gap on ARM32
While binutils 2.25 incorrectly changed the page size
to 64K, the second part of that fix prevents the bug
anyways

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-12-04 10:43:59 +00:00
Callum Farmer
c600b4e9a5 arm64 lds: move 64K gap to reloc
The PE32 header means code ends at end of text, unlike
ELF where its mostly dynamic

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-11-28 16:34:07 +00:00
Callum Farmer
a5f306c401 ctors.S: Align with linker scripts
Remove end padding
Change start padding to 16

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-11-28 16:34:07 +00:00
Xiaotian Wu
98f7e9bd21 add non-executable GNU stack marking on ELF-linux
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
2023-08-26 11:07:14 +08:00
Xiaotian Wu
9298f84d8d Make loongarch64 use efi-app-loongarch64
Binutils 2.41 now supports efi-app-loongarch64, so to use this we must add a
dummy reloc section and remove the PE header definition from crt0 as this will
conflict with the version added by objcopy

Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
2023-08-24 11:35:47 +08:00
Xiaotian Wu
b9c62d6b03 Add some definitions for LoongArch
Added CHAR8, CHAR16, WCHAR and VOID type definitions for LoongArch
2023-08-24 09:48:58 +08:00
Callum Farmer
ebe2358ae7 Add EFI_NORETURN for declspec
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-08-12 12:58:02 +01:00
Callum Farmer
3d83038cbc Rename ALIGN to EFI_ALIGN
Avoid conflict with other libraries

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-08-12 12:43:40 +01:00
Callum Farmer
965f557ab7 Update OS Indications to 2.10
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-07-10 15:54:15 +01:00
Callum Farmer
fd37dafe0b Update memory types to 2.10
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-07-10 15:31:54 +01:00
Callum Farmer
de6f9259e8 Update error/warning codes to 2.10
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-07-09 17:25:32 +01:00
Callum Farmer
7c6975aa56 Update table revisions to 2.10
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-07-09 17:25:31 +01:00
b'Nigel Croxon
f5bb5112de Merge /u/gmbr3/gnu-efi/ branch shim into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/61/
2023-07-07 13:13:41 +00:00
Callum Farmer
cd78649395 ARM32: Only use 4K pages
Turns out some linkers have set page size to 64K on ARM32 aswell
so apply the same fix as ARM64

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-07-06 19:16:32 +01:00
Peter Jones
6ba063ff00 Add missing EFI_VARIABLE_... definition.
This adds the definition for EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS.

Signed-off-by: Peter Jones <pjones@redhat.com>
2023-07-06 14:26:06 +01:00
Peter Jones
93b2524a96 Add some missing definitions for system table revisions
Signed-off-by: Peter Jones <pjones@redhat.com>
2023-07-06 14:25:28 +01:00
Peter Jones
deb8a7f267 Make CopyMem() and SetMem() be EFIAPI
For wildly unknown reasons, EFI Boot Services includes CopyMem() and
SetMem() functions, and they are marked as EFIAPI functions.

This patch marks gnu-efi's CopyMem() and SetMem() as EFIAPI functions,
and makes their exposed API match the misguided nonsense in the EFI
spec, so that they can be used there in a test environment.

Signed-off-by: Peter Jones <pjones@redhat.com>
2023-07-06 14:23:42 +01:00
Peter Jones
ce625f353e Add EFI_MEMORY_ATTRIBUTE_PROTOCOL
Signed-off-by: Peter Jones <pjones@redhat.com>
2023-07-06 14:21:27 +01:00
Peter Jones
108666ffe9 Fix some EFI_MEMORY_FOO definitions
Signed-off-by: Peter Jones <pjones@redhat.com>
2023-07-06 14:20:27 +01:00
Nigel Croxon
4b6f37e74c remove superfluous -fno-stack-check
Signed-off-by: David Müller <d.mueller@elsoft.ch>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2023-07-03 09:19:50 -04:00
Callum Farmer
bbffe42b46 Move OPTNONE macro to eficompiler.h
This is also useful in downstream projects so add it
to public header

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 22:19:54 +01:00
Callum Farmer
6f333cfc91 Tail calls break ctors/dtors
Add macro EFI_NO_TAIL_CALL which disables tail call
optimization on a per-function basis

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 20:33:35 +01:00
Callum Farmer
708f66acfe riscv64: ignore unknown relocs
Sometimes ld emits relocs such as R_RISCV_64 for unwind symbols
these don't need to be handled yet so just can be skipped otherwise
the binary will never load

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
58dce6991b riscv64: fix image
- Make it actually work
- Split text/data/reloc/rodata sections
- Move hash sections to past end of image
  (un-needed in PE)
- Correct section & file alignment
- Correct image size

Builds correctly but untested

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
50b27a854c ARM32: fix image
- Make it actually work
- Split text/data/reloc/rodata sections
- Move hash sections to past end of image
  (un-needed in PE)
- Correct section & file alignment
- Correct image size
- rename .reloc to .areloc within ELF
  as only on ARM32 does this name cause
  it to be marked as REL and subsequently
  mistakenly added to RELSZ

Builds correctly & tested working in QEMU

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
8abf159da6 Merge .plt into .text
ld writes .plt immediately after .text
which corrupts the alignment of .reloc

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
b3e80c38bc Split out rodata
rodata should be split for security

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
1be024100e .dynsym not required
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
2011093544 Clean up size symbols
Tells ld to define them after their markers

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:58 +01:00
Callum Farmer
5e85f477fb Add C++ extern C header markers
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-21 12:28:45 +01:00
Callum Farmer
53b89f528d X86_64: fix clang
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-10 19:25:18 +01:00
Callum Farmer
64027ee986 Mark _start as function
Currently marked as NOTYPE

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-07 15:54:41 +01:00
Callum Farmer
db351e8a78 ARM32: _start must be global
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-06-02 22:14:11 +01:00
Callum Farmer
039ca9d93c Add full Data Directories table
Microsoft dumpbin doesn't like the binary if
the full table doesn't exist

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-31 19:16:53 +01:00
b'Nigel Croxon
67762bdb85 Merge /u/gmbr3/gnu-efi/ branch ia32 into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/54/
2023-05-23 14:52:46 +00:00
Callum Farmer
0fe8def9b6 ARM32: fix L_DYNAMIC
L_DYNAMIC must be 32bits to be PCREL

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-23 15:44:14 +01:00
Callum Farmer
584425eb2a ctors.S: Fix section definitions
Using @ doesn't work on ARM32

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-23 15:37:42 +01:00
b'Nigel Croxon
a1ffc0d4ee Merge /u/gmbr3/gnu-efi/ branch ia32 into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/53/
2023-05-22 11:50:55 +00:00
Callum Farmer
d96b34e0dd riscv: Use new ctors _entry func as entry point
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-20 20:02:49 +01:00
Callum Farmer
d8e6b531ef riscv64 lds: fix ctors/dtors
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-20 19:13:14 +01:00
Callum Farmer
1e0f0df537 riscv: Avoid TEXTREL
Use expression instead of variable for _data_size

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-20 15:34:03 +01:00
Callum Farmer
9e6cb2150b Avoid processor dependent sizes in assembly
.word -> .2byte
.short -> .2byte
.long -> .4byte
.quad -> .8byte

Reference: b83f0845b5
Fixes: https://sourceforge.net/p/gnu-efi/bugs/37/

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
2023-05-20 14:50:46 +01:00
b'Nigel Croxon
20d8d8adc7 Merge /u/moodyhunter/gnu-efi/ branch master into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/52/
2023-05-18 14:14:54 +00:00
b'Nigel Croxon
9835e11ebe Merge /u/gmbr3/gnu-efi/ branch ia32 into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/51/
2023-05-16 13:06:32 +00:00