mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-11-04 05:25:45 +01:00 
			
		
		
		
	The .dynamic section is needed for ELF runtime relocation. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
		
			
				
	
	
		
			79 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/** @file
 | 
						|
 | 
						|
  Unified linker script for CLANG based builds
 | 
						|
 | 
						|
  Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
 | 
						|
  Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
 | 
						|
  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 | 
						|
 | 
						|
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
						|
 | 
						|
**/
 | 
						|
 | 
						|
SECTIONS {
 | 
						|
 | 
						|
  /*
 | 
						|
   * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequence of
 | 
						|
   * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs
 | 
						|
   * between 32-bit and 64-bit builds). The actual start of the .text section
 | 
						|
   * will be rounded up based on its actual alignment.
 | 
						|
   */
 | 
						|
  . = PECOFF_HEADER_SIZE;
 | 
						|
 | 
						|
  .text : ALIGN(CONSTANT(MAXPAGESIZE)) {
 | 
						|
    *(.text .text.* .stub .gnu.linkonce.t.*)
 | 
						|
    *(.rodata .rodata.* .gnu.linkonce.r.*)
 | 
						|
    *(.got .got.*)
 | 
						|
 | 
						|
    /*
 | 
						|
     * The contents of AutoGen.c files are mostly constant from the POV of the
 | 
						|
     * program, but most of it ends up in .data or .bss by default since few of
 | 
						|
     * the variable definitions that get emitted are declared as CONST.
 | 
						|
     * Unfortunately, we cannot pull it into the .text section entirely, since
 | 
						|
     * patchable PCDs are also emitted here, but we can at least move all of the
 | 
						|
     * emitted GUIDs here.
 | 
						|
     */
 | 
						|
    *:AutoGen.obj(.data.g*Guid)
 | 
						|
  }
 | 
						|
 | 
						|
  /*
 | 
						|
   * The alignment of the .data section should be less than or equal to the
 | 
						|
   * alignment of the .text section. This ensures that the relative offset
 | 
						|
   * between these sections is the same in the ELF and the PE/COFF versions of
 | 
						|
   * this binary.
 | 
						|
   */
 | 
						|
  .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(MAXPAGESIZE)) {
 | 
						|
    *(.data .data.* .gnu.linkonce.d.*)
 | 
						|
    *(.bss .bss.*)
 | 
						|
  }
 | 
						|
 | 
						|
  .eh_frame ALIGN(CONSTANT(MAXPAGESIZE)) : {
 | 
						|
    KEEP (*(.eh_frame))
 | 
						|
  }
 | 
						|
 | 
						|
  .rela (INFO) : {
 | 
						|
    *(.rela .rela.*)
 | 
						|
  }
 | 
						|
 | 
						|
  .hii : ALIGN(CONSTANT(MAXPAGESIZE)) {
 | 
						|
    KEEP (*(.hii))
 | 
						|
  }
 | 
						|
 | 
						|
  /*
 | 
						|
   * Retain the GNU build id but in a non-allocatable section so GenFw
 | 
						|
   * does not copy it into the PE/COFF image.
 | 
						|
   */
 | 
						|
  .build-id (INFO) : { *(.note.gnu.build-id) }
 | 
						|
 | 
						|
  /DISCARD/ : {
 | 
						|
    *(.note.GNU-stack)
 | 
						|
    *(.gnu_debuglink)
 | 
						|
    *(.interp)
 | 
						|
    *(.dynsym)
 | 
						|
    *(.dynstr)
 | 
						|
    *(.hash .gnu.hash)
 | 
						|
    *(.comment)
 | 
						|
    *(COMMON)
 | 
						|
  }
 | 
						|
}
 |