summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge /u/gmbr3/gnu-efi/ branch ia32 into masterHEADmasterb'Nigel Croxon2023-05-1617-109/+238
|\ | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/51/
| * Structs with no linkageCallum Farmer2023-05-112-6/+8
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Add test for ctors & dtors with a priorityCallum Farmer2023-05-072-1/+30
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * No cleanCallum Farmer2023-05-071-0/+2
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Re-write entry.c/ctors.S to work betterCallum Farmer2023-05-072-22/+25
| | | | | | | | | | | | | | * Make entry.c work correctly in reverse order * Remove incorrectly sized (on non-32bit) NULLs from ctors.S Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * entry.c: fini_array is run backwardsCallum Farmer2023-05-071-1/+1
| | | | | | | | | | | | fini_array is 65535 to 0 but stored 0 to 65535 Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Align all ctors/dtors start to 16Callum Farmer2023-05-078-0/+24
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * entry.c: Fix null pointer exceptionCallum Farmer2023-05-071-4/+4
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Copy marker names from binutils for init/finiCallum Farmer2023-05-0410-44/+44
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * entry.c: .ctors is run backwardsCallum Farmer2023-05-041-1/+1
| | | | | | | | | | | | | | | | Store forwards, run backwards (65535 to 0) Ref: https://github.com/bminor/binutils-gdb/blob/5a8e7e1332c35d4d5bed67adccd9d66f5cf62c4e/ld/scripttempl/elf.sc#L310 Ref: https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * lds: Support ctors/dtors with a priorityCallum Farmer2023-05-048-64/+96
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Merge ctors/dtors rela sectionsCallum Farmer2023-05-049-0/+37
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Enforce nocombrelocCallum Farmer2023-05-041-1/+1
| | | | | | | | | | | | | | It is needed to avoid ELF reloc (rela) issues and to find un-merged reloc sections Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * ctors.S: Use LSB defined section permsCallum Farmer2023-05-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Seems to not be correct at the moment, causes errors. error: expected the entry size .section .fini_array, "aM", @fini_array Change per https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/specialsections.html Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * Use -std instead of --stdCallum Farmer2023-05-041-2/+2
| | | | | | | | | | | | --std isn't standardised. lol. Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | Revert "Make ELF constructors/destructors work"Nigel Croxon2023-05-161-4/+4
| | | | | | | | This reverts commit fe76d597a9b85f8af55235dd41722abf8fe63ca1.
* | Make ELF constructors/destructors workNigel Croxon2023-05-161-4/+4
|/ | | | | | | | | | | Since commit [4f8b339facb471192e021fffd5db545a0fbddbc3] Simple EFI tools like for example t.c from the apps directory crash. The reason seems to be a wrong null-pointer check in the ctors()/dtors() functions in lib/entry.c. sourceforge.net/u/davemueller Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
* Bump revision to VERSION = 3.0.173.0.17Nigel Croxon2023-05-021-1/+1
|
* ia32: No sdata sectionCallum Farmer2023-04-211-15/+1
| | | | | | | | There is no small data section on ia32, this ends up being created as ld puts .got/.got.plt here due to first declaration Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* ia32 GNUC: Use __asm__ instead of asmCallum Farmer2023-04-211-1/+1
| | | | | | | Causes an error when using strict ISO modes as then asm isn't defined Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* Bump revision to VERSION = 3.0.163.0.16Nigel Croxon2023-04-171-1/+1
|
* Merge /u/gmbr3/gnu-efi/ branch TRUEFALSE into masterb'Nigel Croxon2023-04-171-0/+5
|\ | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/49/
| * Make TRUE/FALSE compatible with C23/C++Callum Farmer2023-04-151-0/+5
| | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | Merge /u/gmbr3/gnu-efi/ branch CHAR16 into masterb'Nigel Croxon2023-04-177-63/+36
|\ \ | | | | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/48/
| * | Make VOID a typedefCallum Farmer2023-04-137-7/+7
| | | | | | | | | | | | | | | | | | | | | 'void' is a type so VOID can be typedef instead of a '#define' to improve compiler output Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
| * | Make WCHAR and CHAR16 identicalCallum Farmer2023-04-087-56/+29
| | | | | | | | | | | | | | | | | | | | | | | | And actually use wchar_t gnu-efi already uses L string literals which are of type wchar_t Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | | Merge /u/gmbr3/gnu-efi/ branch unsigned-char into masterb'Nigel Croxon2023-04-171-2/+2
|\ \ \ | | | | | | | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/47/
| * | | ISO-Latin-1 requires unsigned charCallum Farmer2023-04-081-2/+2
| |/ / | | | | | | | | | | | | | | | | | | It has characters from 0 to 256 so this requires an unsigned 8 bit value Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | | Merge /u/gmbr3/gnu-efi/ branch nullptr into masterb'Nigel Croxon2023-04-171-0/+8
|\ \ \ | | | | | | | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/46/
| * | | Make NULL compatible with C23/C++Callum Farmer2023-04-071-0/+8
| |/ / | | | | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | | Merge /u/gmbr3/gnu-efi/ branch pkgconf2 into masterb'Nigel Croxon2023-04-175-12/+36
|\ \ \ | | | | | | | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/45/
| * | | Add pkgconfig fileCallum Farmer2023-04-075-12/+36
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add EXEC_PREFIX and INCLUDEDIR variables This was requested by fwupd-efi, to be able to retrieve the version number of gnu-efi so we can detect features Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | | Merge /u/yetist/gnu-efi/ branch dev-master into masterb'Nigel Croxon2023-04-171-0/+8
|\ \ \ | |_|/ |/| | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/33/
| * | Add PE machine type definitions for the LoongArchXiaotian Wu2023-01-041-0/+8
| | | | | | | | | | | | | | | | | | See https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
* | | Merge /u/gmbr3/gnu-efi/ branch boolean into masterb'Nigel Croxon2023-04-041-0/+8
|\ \ \ | | | | | | | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/43/
| * | | Use C/C++ boolean when availableCallum Farmer2023-04-041-0/+8
| | |/ | |/| | | | | | | Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
* | | make: Fix shell exit status handlingRichard Hughes2023-04-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Right now whenever we have shell commands with loops, errors in the middle are accidentally ignored, and make continues to process commands. This adds 'set -e' to all of those, so they'll propagate back up. Signed-off-by: Peter Jones <pjones@redhat.com>
* | | Use CFLAGS with "gcc -print-libgcc-file-name" to get the right one.Peter Jones2023-04-041-4/+4
| | | | | | | | | | | | | | | | | | | | | This makes us use CFLAGS when trying to find libgcc, so we don't get the one with the wrong endian or float ABI. Signed-off-by: Peter Jones <pjones@redhat.com>
* | | Make: make "make DESTDIR=../foo install" work right.Peter Jones2023-04-041-1/+13
| | | | | | | | | | | | | | | | | | | | | This makes the normal DESTDIR= variable work on the command line, and makes relative paths always relative to the top-level directory. Signed-off-by: Peter Jones <pjones@redhat.com>
* | | Implement Print(L"%p", ptr);Peter Jones2023-04-041-0/+14
|/ / | | | | | | Signed-off-by: Peter Jones <pjones@redhat.com>
* | Make ELF constructors and destructors workPeter Jones2023-03-2821-55/+380
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes setup and teardown functions defined with __attribute__((__constructor__) and __attribute__((__destructor__)) work in normal circumstances in EFI binaries. A couple of notes: - it implements both the old-style .ctors/.dtors methods and the newer style .init_array/.fini_array ELF constructor and destructor arrays, processed in the order: .init_array[] .ctors[] efi_main() .dtors[] .fini_array[] - Destructors will only be called if efi_main() exits using "return"; any call to Exit() will still longjmp() past them. - InitializeLib() has already been called before constructors run, so they don't need to call it (and neither does anything else.) For compatibility, it has been altered so calling it more than once is safe. - No attempt is made to handle any constructor or destructor with a prototype other than "void func(void);", but note that InitializeLib has been called, so LibImageHandle, ST, BS, and RT are set. - The init_array/ctor/dtor/fini_array lists aren't the using the GNU "CONSTRUCTOR" output section command, so they don't start with a size. - The lists are individually sorted during the link stage via SORT_BY_NAME() in the linker script. - The default (empty) init_array/ctor/dtor/fini_array lists are padded out to 8-byte alignment with ".p2align 3, 0", and each list always has at least one ".long 0" at the end of it (even if it's completely empty). As a result, they can have NULLs that need to be skipped. The sections they're in are mergeable, so the NULLs don't have to be exclusively at the end. - The ia64 and mips64el arches have not been tested. Signed-off-by: Peter Jones <pjones@redhat.com>
* | Make CHAR8 and similar be defined the same way edk2 does it.Peter Jones2023-03-287-6/+44
| | | | | | | | Signed-off-by: Peter Jones <pjones@redhat.com>
* | CFLAGS: add -Wno-pointer-signPeter Jones2023-03-281-1/+1
| | | | | | | | Signed-off-by: Peter Jones <pjones@redhat.com>
* | Semi-asciibetize _Print()'s formatters.Peter Jones2023-03-281-67/+65
| | | | | | | | | | | | | | This is ascii order but with upper and lower case letters mixed, so things like 'X' and 'x' that use fallthrough still stay together. Signed-off-by: Peter Jones <pjones@redhat.com>
* | Switch to -fPIEPeter Jones2023-03-281-2/+2
| | | | | | | | Signed-off-by: Peter Jones <pjones@redhat.com>
* | Remove the accidentally created lib/Makefile.origPeter Jones2023-03-281-91/+0
| | | | | | | | | | | | This was added in dae0b4b0b0d522caecf09123db2cf0250c37a169. Signed-off-by: Peter Jones <pjones@redhat.com>
* | Fix a minor coverity complaint in some appsPeter Jones2023-03-282-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity added a new kind of check, and it noticed some minor errors with some types in two of the apps here, both of the same form: 1. gnu-efi-3.0.6/apps/lfbgrid.c:91: overflow_before_widen: Potentially overflowing expression "info->VerticalResolution * info->PixelsPerScanLine" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "UINTN" (64 bits, unsigned). 1. gnu-efi-3.0.6/apps/bltgrid.c:67: overflow_before_widen: Potentially overflowing expression "info->VerticalResolution * info->HorizontalResolution" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "UINTN" (64 bits, unsigned). This resolves both issues. Signed-off-by: Peter Jones <pjones@redhat.com>
* | lfbgrid: Make pointer size testing not arch name dependentPeter Jones2023-03-281-8/+4
| |
* | Merge /u/gmbr3/gnu-efi/ branch gc-sections into masterb'Nigel Croxon2023-03-234-4/+4
|\ \ | | | | | | | | | https://sourceforge.net/p/gnu-efi/code/merge-requests/42/
| * | Prevent deletion of .reloc by gc-sectionsCallum Farmer2023-03-224-4/+4
| | | | | | | | | | | | | | | | | | | | | Add keyword KEEP to prevent .reloc being removed when using --gc-sections with GNU ld Signed-off-by: Callum Farmer <gmbr3@opensuse.org>