Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aa64 fixes #6

Open
wants to merge 7 commits into
base: rawhide
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)

endif

# On some archs, binutils can have a larger max page size. All our .lds
# assume 4k however, and without this, they might end up blending .text
# and .data into the same segment, making it RWE
LDFLAGS += -z max-page-size=4096

TARGETS = $(TARGET_APPS) $(TARGET_BSDRIVERS) $(TARGET_RTDRIVERS)

all: $(TARGETS)
Expand Down
4 changes: 4 additions & 0 deletions apps/trivial.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ _start:
hello: .byte 'h',0,'e',0,'l',0,'l',0,'o',0,'\n',0,'\r',0,0,0

#endif

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions gnuefi/crt0-efi-aa64.S
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ _start:

0: ldp x29, x30, [sp], #32
ret

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions gnuefi/crt0-efi-arm.S
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,7 @@ _start:

.L_DYNAMIC:
.word _DYNAMIC - .

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions gnuefi/crt0-efi-ia32.S
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ _start:
.long .dummy1-.dummy0 // Page RVA
.long 10 // Block Size (2*4+2)
.word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions gnuefi/crt0-efi-ia64.S
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ _start_plabel:
data4 12 // Block Size (2*4+2*2)
data2 (IMAGE_REL_BASED_DIR64<<12) + 0 // reloc for plabel's entry point
data2 (IMAGE_REL_BASED_DIR64<<12) + 8 // reloc for plabel's global pointer

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions gnuefi/crt0-efi-mips64el.S
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,7 @@ _pc:
.end _start

.set pop

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
3 changes: 3 additions & 0 deletions gnuefi/crt0-efi-x64.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ _start:
.long 10 // Block Size (2*4+2)
.word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
2 changes: 1 addition & 1 deletion gnuefi/elf_aa64_efi.lds
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ SECTIONS
}
_etext = .;
_text_size = . - _text;
.dynamic : { *(.dynamic) }
.data : ALIGN(4096)
{
_data = .;
Expand Down Expand Up @@ -60,6 +59,7 @@ SECTIONS
_bss_end = .;
}

.dynamic : { *(.dynamic) }
.rela.dyn : { *(.rela.dyn) }
.rela.plt : { *(.rela.plt) }
.rela.got : { *(.rela.got) }
Expand Down
4 changes: 4 additions & 0 deletions gnuefi/reloc_ia64.S
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,7 @@ apply_FPTR64:
fptr_mem_base:
.space MAX_FUNCTION_DESCRIPTORS*16
fptr_mem_limit:

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
2 changes: 1 addition & 1 deletion inc/aa64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ EFI_ARCH_3264 :=
EFI_ARCH_SUBSYSTEM := 0xa

EFI_ARCH_CFLAGS := -mstrict-align -DPAGE_SIZE=4096 -DPAGE_SHIFT=12
EFI_ARCH_LDFLAGS := --defsym=EFI_SUBSYSTEM=$(EFI_ARCH_SUBSYSTEM)
EFI_ARCH_LDFLAGS := --defsym=EFI_SUBSYSTEM=$(EFI_ARCH_SUBSYSTEM) -z max-page-size=4096
EFI_ARCH_FORMAT := -O binary
EFI_ARCH_SUFFIX := aa64
EFI_ARCH_SUFFIX_UPPER := AA64
Expand Down
1 change: 1 addition & 0 deletions inc/aa64/efisetjmp_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ typedef struct {
UINT64 FP;
UINT64 LR;
UINT64 IP0;
UINT64 _pad1;

/* FP regs */
UINT64 D8;
Expand Down
4 changes: 2 additions & 2 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ all: libsubdirs libefi.a
libsubdirs:
@set -e ; for sdir in $(SUBDIRS); do mkdir -p $$sdir; done

$(OBJS): libsubdirs

libefi.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $^

Expand All @@ -92,5 +94,3 @@ install_compat: install
$(SYMLINK) gnuefi/$(ARCH)/libefi.a $(INSTALLROOT)$(LIBDIR)/libefi.a

include $(SRCDIR)/../Make.rules

.PHONY: libsubdirs
4 changes: 4 additions & 0 deletions lib/aa64/efi_stub.S
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* This stub is a stub to make the build happy */

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/aa64/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ longjmp:
mov w0, #1
csel w0, w1, w0, ne
br x30

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/arm/div.S
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,7 @@ label1:
@ What to do about division by zero? For now, just return.
ASM_PFX(__aeabi_idiv0):
bx r14

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/arm/efi_stub.S
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* This stub is a stub to make the build happy */

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
5 changes: 3 additions & 2 deletions lib/arm/ldivmod.S
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ L_Test3:
L_Exit:
pop {r4,pc}



#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/arm/llsl.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ ASM_PFX(__aeabi_llsl):
lsl r1,r0,r3
mov r0,#0
bx lr

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/arm/llsr.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ ASM_PFX(__aeabi_llsr):
lsr r0,r1,r3
mov r1,#0
bx lr

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/arm/mullu.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ ASM_PFX(__aeabi_lmul):
mla r1, r2, r1, ip
mla r1, r3, lr, r1
ldmia sp!, {pc}

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/arm/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ setjmp:
.type longjmp, %function
longjmp:
ldmia r0, {r3-r12,r14}

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 3 additions & 1 deletion lib/arm/uldiv.S
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,6 @@ ASM_PFX(_ll_div0):
ASM_PFX(__aeabi_ldiv0):
bx r14


#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
3 changes: 3 additions & 0 deletions lib/ctors.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ _fini_array:
_fini_array_end:
.long 0

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/ia32/efi_stub.S
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* This stub is a stub to make the build happy */

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/ia32/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ longjmp:
movl (%edx), %ebx
movl 4(%edx), %esi
movl 8(%edx), %edi

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
3 changes: 3 additions & 0 deletions lib/ia64/palproc.S
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,6 @@ StackedComeBackFromPALCall:

PROCEDURE_EXIT(MakeStackedPALCall)

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/ia64/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,7 @@ _skip_flushrs:
invala
mov ar.rsc = r16
br.ret.sptk b0

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/mips64el/efi_stub.S
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* This stub is a stub to make the build happy */

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/mips64el/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ longjmp:
li $v0, 1
movn $v0, $a1, $a1
jr $ra

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/x64/efi_stub.S
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,7 @@ ENTRY(efi_call10)
ret

#endif

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif
4 changes: 4 additions & 0 deletions lib/x64/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ longjmp:
cmp %rax,%rdx
cmove %rcx,%rax
jmp *0x38(%rdi)

#if defined(__ELF__) && defined(__linux__)
.section .note.GNU-stack,"",%progbits
#endif