diff --git a/tests/Makefile.am b/tests/Makefile.am index 793ab26..c5b008c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,27 +10,27 @@ check_PROGRAMS = test-x86_64.pecoff test-i386.pecoff check_DATA = $(test_key) $(test_cert) check_SCRIPTS = test-wrapper.sh -test_i386_pecoff_SOURCES = test.S test-i386.lds -test_x86_64_pecoff_SOURCES = test.S test-x86_64.lds +test_i386_pecoff_SOURCES = test.S +test_x86_64_pecoff_SOURCES = test.S test-%.pecoff: test-%.elf $(OBJCOPY) -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel \ -j .rela -j .reloc \ - --target=efi-app-$(test_image_arch) $^ $@ + --target=$(test_lds) $^ $@ $(STRIP) $@ test-x86_64.pecoff: test_image_arch = x86-64 -test-x86_64.pecoff: test_lds = $(srcdir)/test-x86_64.lds +test-x86_64.pecoff: test_lds = efi-app-x86_64 test-x86_64.pecoff: ASFLAGS += -m64 test-x86_64.pecoff: LDFLAGS += -m64 test-i386.pecoff: test_image_arch = i386 -test-i386.pecoff: test_lds = $(srcdir)/test-i386.lds +test-i386.pecoff: test_lds = efi-app-ia32 test-i386.pecoff: ASFLAGS += -m32 test-i386.pecoff: LDFLAGS += -m32 -test-%.elf: LDFLAGS = -nostdlib -T $(test_lds) -test-%.elf: test-%.$(OBJEXT) $(test_lds) +test-%.elf: LDFLAGS += -nostdlib +test-%.elf: test-%.$(OBJEXT) $(LINK) $< test-%.$(OBJEXT): $(srcdir)/test.S diff --git a/tests/test-i386.lds b/tests/test-i386.lds deleted file mode 100644 index 5f46c58..0000000 --- a/tests/test-i386.lds +++ /dev/null @@ -1,59 +0,0 @@ -OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") -OUTPUT_ARCH(i386) -ENTRY(_start) -SECTIONS -{ - . = 0; - ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ - . = ALIGN(4096); - .eh_frame : - { - *(.eh_frame) - } - . = ALIGN(4096); - .text : - { - *(.text) - } - . = ALIGN(4096); - .reloc : - { - *(.reloc) - } - . = ALIGN(4096); - .data : - { - *(.rodata*) - *(.got.plt) - *(.got) - *(.data*) - *(.sdata) - /* the EFI loader doesn't seem to like a .bss section, so we stick - it all into .data: */ - *(.sbss) - *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - *(.rel.local) - } - . = ALIGN(4096); - .dynamic : { *(.dynamic) } - . = ALIGN(4096); - .rela : - { - *(.rela.data*) - *(.rela.got) - *(.rela.stab) - } - . = ALIGN(4096); - .dynsym : { *(.dynsym) } - . = ALIGN(4096); - .dynstr : { *(.dynstr) } - . = ALIGN(4096); - .ignored.reloc : - { - *(.rela.reloc) - } -} diff --git a/tests/test-x86_64.lds b/tests/test-x86_64.lds deleted file mode 100644 index e4eb6ae..0000000 --- a/tests/test-x86_64.lds +++ /dev/null @@ -1,60 +0,0 @@ -/* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */ -OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") -OUTPUT_ARCH(i386:x86-64) -ENTRY(_start) -SECTIONS -{ - . = 0; - ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ - . = ALIGN(4096); - .eh_frame : - { - *(.eh_frame) - } - . = ALIGN(4096); - .text : - { - *(.text) - } - . = ALIGN(4096); - .reloc : - { - *(.reloc) - } - . = ALIGN(4096); - .data : - { - *(.rodata*) - *(.got.plt) - *(.got) - *(.data*) - *(.sdata) - /* the EFI loader doesn't seem to like a .bss section, so we stick - it all into .data: */ - *(.sbss) - *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - *(.rel.local) - } - . = ALIGN(4096); - .dynamic : { *(.dynamic) } - . = ALIGN(4096); - .rela : - { - *(.rela.data*) - *(.rela.got) - *(.rela.stab) - } - . = ALIGN(4096); - .dynsym : { *(.dynsym) } - . = ALIGN(4096); - .dynstr : { *(.dynstr) } - . = ALIGN(4096); - .ignored.reloc : - { - *(.rela.reloc) - } -}