Author: Callum Farmer <gmbr3@opensuse.org>

Date:   Tue Feb 7 21:48:27 2023 +0000

    ARM32/x86_64 lds: Force data segment align to 4KiB

    Some newer versions of binutils can set invalid COMMONPAGESIZE
    and MAXPAGESIZE values on these architectures

    git fetch git.code.sf.net/u/gmbr3/gnu-efi arm-pagesize
    git merge 89d55b364d

    Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Nigel Croxon 2023-02-08 09:25:01 -05:00
commit 637b3bdb9b
4 changed files with 8 additions and 8 deletions

View File

@ -139,7 +139,6 @@ endif
# Set HAVE_EFI_OBJCOPY if objcopy understands --target efi-[app|bsdrv|rtdrv],
# otherwise we need to compose the PE/COFF header using the assembler
#
ifneq ($(ARCH),aarch64)
ifneq ($(ARCH),arm)
ifneq ($(ARCH),mips64el)
ifneq ($(ARCH),riscv64)
@ -149,7 +148,6 @@ endif
endif
endif
endif
endif
ifneq ($(ARCH),arm)
export LIBGCC=$(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
@ -159,6 +157,11 @@ ifeq ($(ARCH),arm)
CFLAGS += -marm
endif
ifeq ($(ARCH),aarch64)
LDFLAGS += -z common-page-size=4096
LDFLAGS += -z max-page-size=4096
endif
# Generic compilation flags
INCDIR += -I$(SRCDIR) -I$(TOPDIR)/inc -I$(TOPDIR)/inc/$(ARCH) \
-I$(TOPDIR)/inc/protocol

View File

@ -29,7 +29,7 @@ SECTIONS
{
*(.reloc)
}
. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
. = ALIGN(65536);
.dynamic : { *(.dynamic) }
.data :
{
@ -69,7 +69,6 @@ SECTIONS
.dynstr : { *(.dynstr) }
. = ALIGN(4096);
.note.gnu.build-id : { *(.note.gnu.build-id) }
. = DATA_SEGMENT_END (.);
.ignored.reloc :
{
*(.rela.reloc)

View File

@ -15,7 +15,7 @@ SECTIONS
}
_etext = .;
_text_size = . - _text;
. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
. = ALIGN(4096);
.dynamic : { *(.dynamic) }
.data :
{
@ -54,7 +54,6 @@ SECTIONS
.dynstr : { *(.dynstr) }
. = ALIGN(4096);
.note.gnu.build-id : { *(.note.gnu.build-id) }
. = DATA_SEGMENT_END (.);
/DISCARD/ :
{
*(.rel.reloc)

View File

@ -30,7 +30,7 @@ SECTIONS
{
*(.reloc)
}
. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
. = ALIGN(4096);
.data :
{
_data = .;
@ -66,7 +66,6 @@ SECTIONS
. = ALIGN(4096);
.dynstr : { *(.dynstr) }
. = ALIGN(4096);
. = DATA_SEGMENT_END (.);
.ignored.reloc :
{
*(.rela.reloc)