| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
| |
fini_array is 65535 to 0 but stored 0 to 65535
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
|
|
|
|
| |
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
|
|
|
|
| |
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Causes an error when using strict ISO modes as
then asm isn't defined
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
This was added in dae0b4b0b0d522caecf09123db2cf0250c37a169.
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The whole gnu-efi project is licensed under BSD license, see [1].
However some of the RISC-V codes have conflict license identifiers:
- Some mention GPL-2.0+ in the SPDX license part, but the long license
header indicates it's actually BSD and GPL-2.0+ dual-licensed
- Some mention GPL-2.0+ in the SPDX license part only
- Some do not have any license indication
To have a matching license with the whole project, this commit updates
all RISC-V codes to have the correct SPDX license identifiers
(GPL-2.0+ or BSD dual-license).
Link: https://sourceforge.net/p/gnu-efi/ [1]
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|\
| |
| |
| | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/29/
|
| |
| |
| |
| | |
jirl -> jr
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
binutils-2.39 enabed a few warning by default
(https://sourceware.org/pipermail/binutils/2022-August/122246.html):
> The ELF linker will now generate a warning message if the stack is made executable.
Let's suppress the warnings in assembly files by adding non-executables
stack markings. This fixes at least systemd build which uses '-Wl,--fatal-warnings':
https://github.com/systemd/systemd/issues/24226
|
|/
|
|
|
|
|
|
|
| |
Without the change there is no guarantee that .o files will be built
after directories are created for them and build fails as:
gcc -I/build/gnu-efi-code//lib ... -c lib/runtime/rtstr.c -o runtime/rtstr.o
Assembler messages:
Fatal error: can't create runtime/rtstr.o: No such file or directory
|
|\
| |
| |
| | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/26/
|
| |
| |
| |
| |
| |
| |
| | |
Add definitions for the EFI device tree table, as specified in UEFI
specification 2.9 (March 2021).
Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
|
|/
|
|
|
|
|
|
|
|
| |
When compiling for x64, Visual Studio 2019's Code Analysis produces the following warnings:
C:\Projects\gnu-efi\lib\print.c(1380): warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).
C:\Projects\gnu-efi\lib\smbios.c(47): warning C26451: Arithmetic overflow: Using operator '+' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '+' to avoid overflow (io.2).
C:\Projects\gnu-efi\lib\str.c(289): warning C26451: Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
Fix these by adding an explicit cast to UINTN.
|
|
|
|
|
|
|
|
|
|
| |
Checking that str is non-zero is superfluous in
(*str && *str == ' ')
0x20 is always non-zero.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|
|
|
|
|
|
| |
AllocatePool() may return NULL. We must check the return value before
dereferencing it.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|
|
|
|
|
| |
For each va_start() there must be a call to va_end().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|\
| |
| |
| | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/17/
|
| |
| |
| |
| |
| |
| | |
Add the RISCV64 architecture
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
GrowBuffer() expects that parameter Status is initialized.
LibGetVariableAndSize() currently passes random data from the stack.
Initialize variable Status.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|\ \
| | |
| | |
| | | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/16/
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
For each va_start() there must be a va_end().
Correct LibInstallProtocolInterfaces() and
LibUninstallProtocolInterfaces().
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|\ \
| | |
| | |
| | | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/15/
|
| |/
| |
| |
| |
| |
| | |
If str == ' ', str has to be non-zero. No extra check is needed.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
|\ \
| | |
| | |
| | | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/13/
|
| | |
| | |
| | |
| | | |
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As EFI_SHELL_PARAMETERS_PROTOCOL is also defined in UEFI Shell Spec,
put it together with EFI_SHELL_PROTOCOL.
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
| | |
| | |
| | |
| | | |
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|\ \ \
| |_|/
|/| |
| | | |
https://sourceforge.net/p/gnu-efi/code/merge-requests/12/
|
| | |
| | |
| | |
| | | |
Signed-off-by: Kagurazaka Kotori <kagurazakakotori@gmail.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Per https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/PrintLib.h
those are the names used by EDK2, so make these our official names as well.
For compatibility with older gnu-efi versions, also keep SPrint and VSPrint defined.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Per https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Guid/FileSystemVolumeLabelInfo.h
the EDK2 uses EFI_FILE_SYSTEM_VOLUME_LABEL and EFI_FILE_SYSTEM_VOLUME_LABEL_ID rather
than EFI_FILE_SYSTEM_VOLUME_LABEL_INFO and EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID.
We redefine those to the proper EDK2 names, while also adding defines for compatibility.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Per https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/BaseMemoryLib.h
"(CopyMem) must handle the case where SourceBuffer overlaps DestinationBuffer".
Having the gnu-efi version of CopyMem differ from the EDK2 version can lead to
extremely hard to troubleshoot issues as well as very unexpected results. So
make sure our version follows the same guidelines.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Having to add specific arch include paths and then <gnu-efi>/lib
to be able to use gnu-efi in an application is annoying.
This patch ensures that the library itself takes care of including
the relevant headers, and that one needs only to add <gnu-efi>/inc
in their include path to be able to use gnu-efi.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
Per https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/PrintLib.h
AsciiPrint() is the official name of APrint() so declare it as such and define
an APrint alias for compatibility.
Also add an AsciiVSPrint() to print a formatted ASCII string to a buffer using
a va_list. AsciiPrint() too is defined in EDK2's PrintLib.h, though our implementation
just invokes the Unicode version and then converts the buffer to ASCII.
|
|/
|
|
|
|
|
|
| |
Key input should be consumed to prevent WaitForKey event from being
always triggered and potential buffer overflow.
This fixes issue #26.
Signed-off-by: Kagurazaka Kotori <kagurazakakotori@gmail.com>
|
|
|
|
| |
Signed-off-by: Kagurazaka Kotori <kagurazakakotori@gmail.com>
|
|
|
|
| |
Also fix some small whitespace issues.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On couple of locations in runtime string library (rtstr.c)
there are calls to non-runtime variant of StrLen function.
* Another issue is with formatting 1394 paths.
The F1394_DEVICE_PATH::Guid is formatted as %g, but 1394
GUID is 8 byte integer, not EFI_GUID and therefore should
be formatted as e.g. %016lx (as edk2 does).
* Beyond what's mentioned above, changed the format of the
harddrive path, so it's in line with edk2 format and spec
(2.7 errata A, chapter 10.6.1.6, table 102).
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Signed-off-by: manison <manison@users.sf.net>
|
|
|
|
|
|
|
|
|
| |
The arguments to SetMem() were wrong. Besides, SetMem() should start at
"Dest + Size" since "Size" will be smaller than "Len" if they are not
equal.
Signed-off-by: Gary Lin <glin@suse.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
|
|
|
|
|
|
|
|
| |
StrnCpy() doesn't guarantee the dest string will be null-terminated, so
we shouldn't use StrnCpy().
Signed-off-by: Gary Lin <glin@suse.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The arguments to SetMem() were wrong. Besides, SetMem() should start at
"Dest + Size" since "Size" will be smaller than "Len" if they are not
equal.
Signed-off-by: Gary Lin <glin@suse.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
|