Commit Graph

25 Commits

Author SHA1 Message Date
Sergei Trofimovich
803b49c40b */*.S: add non-executable GNU stack marking on ELF-linux
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
2022-08-08 11:35:10 -04:00
b'Nigel Croxon
40160210a7 Merge /u/xypron/gnu-efi/ branch misc_fixes into master
https://sourceforge.net/p/gnu-efi/code/merge-requests/25/
2021-06-24 12:16:12 +00:00
Heinrich Schuchardt
4fe83e1026 apps: memory leak in draw_boxes()
Free the buffer allocated to draw boxes.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-23 23:22:41 +02:00
Heinrich Schuchardt
58124a7fea apps: define FrameBufferAddr for riscv64
The size of FrameBufferAddr is architecture dependent. Add the missing
definition for the riscv64 architecture.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-23 22:56:29 +02:00
Heinrich Schuchardt
01a8d3bb00 apps: simplify logical constraints
EFI_ERROR(EFI_NOT_STARTED) is true. So we can simplify

    (EFI_ERROR(rc) && rc == EFI_NOT_STARTED)

to

    (rc == EFI_NOT_STARTED)

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-23 22:53:26 +02:00
leo
486ba3c3bd Do not include efisetjmp.h on efi.h
People than really want to use efisetjmp implementation can include
the header on their own.

Signed-off-by: leo <leo.sartre@geebol.fr>
2019-05-15 05:32:24 +02:00
Nigel Croxon
5b74db0e15 Redefine jmp_buf to comply with C calling convention.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2019-03-15 09:32:06 -04:00
Peter Jones
b030bfce35 Add debug helper applications
Add debug helper applications.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones
5ec879ace7 apps: Add bltgrid and lfbgrid, and add error checks to modelist
This adds bltgrid and lfbgrid, which draw checkerboards using GOP's
Blt() and linear framebuffer, respectively, and adds some error checks
to modelist.efi.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones
25cebcee2a Fix a sign error in the debughook example app
On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
greater (or equal) to that.  Make it an unsigned and choose a better type
for the variable.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones
e861bb3861 Work around -Werror=maybe-uninitialized not being very bright.
The compiler doesn't believe the loop always executes at least once,
even though the data in the first array entry doesn't satisfy the exit
condition.  So just initialize the thing to shut it up.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:23 -04:00
Peter Jones
a46a62b12b Fix some types gcc doesn't like
Most of these come from building on i386 with -Wextra, but they're still
incorrect everywhere else; they just happen to have identical typedefs
at other places, so the compiler doesn't care.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2018-03-14 14:50:22 -04:00
Nigel Croxon
9d0d941591 apps/tcc: tcc marcked ok for non x86-64 archs
Tested on qemu (x86-64 and arm64).

Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-03-10 16:02:03 -05:00
Nigel Croxon
0e808e122a apps/tcc: remove unneeded includes
Signed-off-by: David Decotigny <<ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-03-10 16:00:06 -05:00
Nigel Croxon
049a863e14 Fixed build issue with apps/exit.c
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-02-17 16:31:39 -05:00
Nigel Croxon
3f8935c3d0 add-Exit - Add Exit() library function which calls BS->Exit()
Signed-off-by: Jonathon Reinhart <jonathon.reinhart@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-02-17 16:30:28 -05:00
Nigel Croxon
787cb7fcd8 fix clang support.
Tested:
  make all apps + tests apps/ on x86_64
  make CC=clang all apps + tests apps/ on x86_64

Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-02-17 16:24:26 -05:00
Nigel Croxon
bdb6182f0a don't expect non-x86 compilers to compile x86 asm.
also remove what looks like garbage inside an #if 0 block.

Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-02-17 16:22:44 -05:00
Nigel Croxon
7b0521df53 remove dead code
Signed-off-by: David Decotigny <ddecotig@gmail.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
2017-02-17 16:19:16 -05:00
Nigel Croxon
87484730de Restore correct operation of BS driver test
Attaching a patch to fix apps/drv0.efi and apps/drv0_use.efi,
which are both currently not working.

Signed-off-by: David Decotigny <gdaviddecotigny@users.sf.net>
Signed-off-by: Nigel Croxon <noxorc@mac.com>
2017-01-08 06:58:30 -05:00
Nigel Croxon
76206d9ebf This -Wall -Wextra thing actually caught a real bug.
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 16:55:26 -05:00
Nigel Croxon
fb8f9bfe52 This makes "-Werror=old-style-declaration" work.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
2016-03-03 16:27:04 -05:00
Nigel Croxon
11a459ba96 This patch makes the following symbols (relatively) consistent between
all of our linker scripts:

_text
_etext
_text_size
_data
_edata
_data_size

There are various things that are slightly different (positions of
.rela*, .dynamic, and similar in relation to .data), but _text and _data
are now always at the beginning of their respective sections with regard
to how a debuger would reference the debug info, and _etext and _edata
are now always extant and guaranteed to be after any of the respective
kind of data the debugger would look for in that section.

This also adds an application example of how it might be used, and a
makefile target for %.efi.debug which will generate a separate debuginfo
file for that example.

This also enables debugging by default (i.e. -g is in CFLAGS) and adds
.note.gnu.build-id sections to our .so files (i.e. --build-id=sha1 is in
LDFLAGS).

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-07-16 12:31:23 -04:00
Nigel Croxon
dae0b4b0b0 Turns out we actually need setjmp in one of gnu-efi's prominent
users, and it seems to make more sense to put it here than in
the application.

All of these are derived from the Tiano code, but I re-wrote the
x86_64 one because we use the ELF psABI calling conventions instead
of the MS ABI calling conventions.  Which is to say you probably
shouldn't setjmp()/longjmp() between functions with EFIAPI (aka
__attribute__((ms_abi))) and those without.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2015-05-14 12:20:51 -04:00
Nigel Croxon
530d68ba19 The gnu-efi-3.0 toplevel subdirectory is really annoying. Kill it.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
2014-11-25 10:09:50 -05:00