[PATCH] D28951: [ELF] - Linkerscripts: ignore CONSTRUCTORS in output section declaration.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 23:52:52 PST 2017


grimar added a comment.

In https://reviews.llvm.org/D28951#651895, @silvas wrote:

> Are you sure that this CONSTRUCTORS is trying to be a linker keyword? The nearby DATA_DATA is actually a macro expanded from http://src.illumos.org/source/xref/linux-master/include/asm-generic/vmlinux.lds.h#205
>  Is the CONSTRUCTORS still in file after it has been preprocessed? (I'm guessing so since otherwise this patch wouldn't fix the build, but just wanted to be sure).
>  Remember to keep in mind that these linker scripts all get preprocessed by the C preprocessor, so remember to look at the preprocessed linker script instead of the original source.


Yes, I am aware this could be macros, but it is not in this case. I verified this when wrote the patch.
Here is a part of script from description after processing I had locally:
(arch/x86/kernel/vmlinux.lds for me)

  .data : AT(ADDR(.data) - 0xffffffff80000000) {
   /* Start of data section */
   _sdata = .;
   /* init_task */
   . = ALIGN(((1 << 12) << (2 + 0))); __start_init_task = .; *(.data..init_task) __end_init_task = .;
   . = ALIGN((1 << 12)); *(.data..page_aligned)
   . = ALIGN((1 << (6))); *(.data..cacheline_aligned)
   *(.data .data.[0-9a-zA-Z_]*) *(.ref.data) *(.data..shared_aligned) *(.meminit.data) *(.memexit.data) *(.data.unlikely) . = ALIGN(32); *(__tracepoints) . = ALIGN(8); __start___jump_table = .; KEEP(*(__jump_table)) __stop___jump_table = .; . = ALIGN(8); __start___verbose = .; KEEP(*(__verbose)) __stop___verbose = .; __start___trace_bprintk_fmt = .; KEEP(*(__trace_printk_fmt)) __stop___trace_bprintk_fmt = .; __start___tracepoint_str = .; KEEP(*(__tracepoint_str)) __stop___tracepoint_str = .;
   CONSTRUCTORS
   /* rarely changed data like cpu maps */
   . = ALIGN((1 << 6)); *(.data..read_mostly) . = ALIGN((1 << 6));
   /* End of data section */
   _edata = .;
  } :data


https://reviews.llvm.org/D28951





More information about the llvm-commits mailing list