summaryrefslogtreecommitdiff
path: root/BaseTools/Scripts
AgeCommit message (Collapse)Author
2015-08-03BaseTools IA32/X64: Use GccBase.lds instead of gcc*-ld-scriptArd Biesheuvel
These scripts all now have the same contents, so we only need to use GccBase.lds. Therefore we can delete gcc-4K-align-ld-script, gcc4.4-ld-script and gcc4.9-ld-script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18142 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools AARCH64: remove incremental linker script for 64K alignmentArd Biesheuvel
Now that we moved all users to the unified GCC linker script, remove the old 64 KB incremental linker script for AARCH64 since it is now unused. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18141 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools AARCH64: move to unified GCC linker scriptArd Biesheuvel
Drop the GCC AARCH64 specific linker script and use the new unified one instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18138 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools GCC: move AutoGen.obj contents to .text sectionArd Biesheuvel
All AutoGen.obj files consist of global GUID definitions, fixed and patchable PCDs and other data that is essentially read-only at runtime but has not been declared as such for various reasons. By moving these contents to .text we achieve two things: - global GUIDs and other data items which must be constant for correct program operation can no longer be modified, for instance, when running a DXE_RUNTIME_MODULE binary under the OS with the Properties Table feature for memory protection enabled; - the .data section becomes smaller, and may be dropped completely for many XIP modules, which reduces wasted FV space if the PE/COFF section alignment is large. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18137 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools GCC: align start of .data to .text alignmentArd Biesheuvel
Now that GenFw honors the ELF section alignment when placing the PE/COFF sections in the output, the start of the PE/COFF version of .data will be aligned to the alignment of .text if its alignment is higher than the default. So duplicate this behavior in the ELF output, this will make the memory layout of the PE/COFF binary match the layout of the ELF version more closely. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18136 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools GCC: add unified GCC linker script for all archs and versionsArd Biesheuvel
This unifies all GCC linker scripts into a single parametrised GCC linker script that can be used for all GCC versions and architectures. The two parameters that can be set on the linker command line are: - PECOFF_HEADER_SIZE, this is a build time property of GenFw, but its value is different between 32-bit and 64-bit; - common-page-size, this can be set using -z on the ld command line, and controls the value of the COMMONPAGESIZE constant when used in a linker script. This value is used for the minimum section alignment. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18135 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: get header size and alignment from ld commandlineArd Biesheuvel
Instead of hardcoding the values for the PE/COFF header size and the section alignment, set them on the linker command line. This factors out these values from the various linker scripts, which will allow us to unify them in a subsequent patch. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18134 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: move .got contents to the PE/COFF .text sectionArd Biesheuvel
Move the .got contents to the PE/COFF .text section. This should be a no-op, since we typically don't generate position independent code (i.e., using -fPIC). But since the GOT contains variable addresses that are updated at relocation time only, its contents are best kept in .text to prevent them from being overwritten inadvertently. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18133 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: drop redundant alignment from linker scriptArd Biesheuvel
There is no need to pad out the end of a section of the start of the following section is aligned to the same value. So drop the redundant ALIGN() statements. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18132 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: move .rodata to PE/COFF .text sectionArd Biesheuvel
The .rodata ELF section contains constant non-executable data that should never be modified by the program itself. Since the risk of inadvertent modification is typically higher than the risk of inadvertent execution, it makes sense to put this data in the R-X .text section rather than in the RW- .data section. So move it there. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18131 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-03BaseTools IA32/X64: remove NOP padding from X86/IA32 GCC linker scriptsArd Biesheuvel
The NOP padding in the GCC linker scripts ensures that all empty regions in the ELF binary are filled with x86 NOP instructions. There is no upside to doing this: if the CPU ends up executing these instructions, we have little hope of resuming normal execution of the program anyway. And having NOP slides in memory only makes it easier for attackers to launch exploits. So remove them. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18130 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-06BaseTools: AArch64: use explicit linker scriptsArd Biesheuvel
Instead of relying on the builtin linker script of GNU ld, which may vary based on binutils version (which is not tightly coupled to the GCC version) and linker command line options, introduce a linker script for AArch64 to be used by all GCC/binutils versions. The script is laid out such that two ELF sections .text and .data are created that map onto the PE/COFF with the same names. By aligning .data to the minimum alignment of .text, and by not adding any additional padding -which is what LD's builtin linker script does- the relative offset between .text and .data is retained after the PE/COFF conversion. This should prevent problems with debuggers and other tooling that are ELF based. Also provided is an overlay linker script that increases the alignment of .text and .data to 64 KB. This is intended for DXE_RUNTIME_DRIVER modules, to make them compatible with the newly introduced Properties Table feature. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <Olivier.Martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17824 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02Revert tree to r17801Jordan Justen
Revert r17802 "BaseTools: AArch64: use explicit linker scripts" Revert r17803 "ArmVirtPkg: build runtime drivers with 64 KB section alignment" Revert r17804 "IntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback" Revert r17805 "IntelFrameworkModulePkg: AcpiS3SaveDxe: call S3Ready() at End-of-Dxe" Revert r17806 "OvmfPkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback" Requested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17807 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-02BaseTools: AArch64: use explicit linker scriptsArd Biesheuvel
Instead of relying on the builtin linker script of GNU ld, which may vary based on binutils version (which is not tightly coupled to the GCC version) and linker command line options, introduce a linker script for AArch64 to be used by all GCC/binutils versions. The script is laid out such that two ELF sections .text and .data are created that map onto the PE/COFF with the same names. By aligning .data to the minimum alignment of .text, and by not adding any additional padding -which is what LD's builtin linker script does- the relative offset between .text and .data is retained after the PE/COFF conversion. This should prevent problems with debuggers and other tooling that are ELF based. Also provided is an overlay linker script that increases the alignment of .text and .data to 64 KB. This is intended for DXE_RUNTIME_DRIVER modules, to make them compatible with the newly introduced Properties Table feature. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17802 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-01There needs to be a space between the output section name and the colon, i.e.,Ard Biesheuvel
.text : ALIGN(0x1000) ^ Fix this for all output sections Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17748 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-29BaseTools: Added GCC ld script to support 4K alignment.Yingke Liu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17728 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-061. Update UpdateBuildVersion.py; Yingke Liu
2. Generate correct HII data offset. 3. Fixed a bug for incorrect PCD value used in conditional statement. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu <yingke.d.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16784 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31BaseTools: Add ConvertMasmToNasm.py scriptJordan Justen
This script is intended to assist with MASM to NASM syntax conversions. The output should be manually inspected and adjusted as needed, since this script does not provide a perfect conversion. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Yingke D Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16285 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-21Setting the svn property, svn:executable on the new scripts.lhauch
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: lhauch <larry.hauch@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15868 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-21Adding files for proposed replacement for edksetup.bat.lhauch
This changes includes new scripts that breaks out some of the functionality in edksetup.bat and eliminates calling the toolsetup.bat file in BaseTools directory. Edk2Setup.bat is to be used for testing. If no bugs are reported by the end of September, 2014, the file will be renamed to edksetup.bat. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: lhauch <larry.hauch@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15867 6f19259b-4bc3-4df7-8a09-765794883524
2014-07-28BaseTools: Add GCC49 toolchain; align data sections to 0x40Jordan Justen
GCC 4.9 may use 64-byte (0x40) alignment for data sections. Therefore we use a different link script for GCC 4.9. The only difference from the gcc4.4-ld-script is the alignment for data sections. When using the GCC48 toolchain with GCC 4.9, this error would be encountered by GenFw: > GenFw: ERROR 3000: Invalid > Unsupported section alignment. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15697 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-23Sync BaseTool trunk (version r2599) into EDKII BaseTools.Liming Gao
Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Heshen Chen <chen.heshen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14591 6f19259b-4bc3-4df7-8a09-765794883524
2011-05-11Sync BaseTools Branch (version r2149) to EDKII main trunk. lgao4
BaseTool Branch: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/branches/Releases/BaseTools_r2100 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11640 6f19259b-4bc3-4df7-8a09-765794883524
2010-05-18Sync EDKII BaseTools to BaseTools project r1971lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10502 6f19259b-4bc3-4df7-8a09-765794883524