[PATCH] D72344: [LLD][ELF][ARM][AArch64] Only round up ThunkSection Size when large OS.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 10:07:15 PST 2020


peter.smith added a comment.

On looking again at the linux kernel makefile

  #define IDMAP_TEXT					\
  	. = ALIGN(SZ_4K);				\
  	__idmap_text_start = .;				\
  	*(.idmap.text)					\
  	__idmap_text_end = .;
  ...
  .text : {			/* Real text segment		*/
  		_stext = .;		/* Text and read-only data	*/
  			IRQENTRY_TEXT
  			SOFTIRQENTRY_TEXT
  			ENTRY_TEXT
  			TEXT_TEXT
  			SCHED_TEXT
  			CPUIDLE_TEXT
  			LOCK_TEXT
  			KPROBES_TEXT
  			HYPERVISOR_TEXT
  			IDMAP_TEXT
  			HIBERNATE_TEXT
  			TRAMP_TEXT
  			*(.fixup)
  			*(.gnu.warning)
  		. = ALIGN(16);
  		*(.got)			/* Global offset table		*/
  	}

It looks like this fix may not be enough if the aggregate size of the .text section is > ThunkSectionSpacing. If it isn't enough then my next preference would be to only set roundUpSizeForErrata if the InputSectionDescription such as *(.idmap.text) is over a certain size. A small InputSectionDescription is not likely to generate a large enough range of patches and thunks to cause the iterate for ever corner case.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72344/new/

https://reviews.llvm.org/D72344





More information about the llvm-commits mailing list