https://bugs.llvm.org/show_bug.cgi?id=44903

            Bug ID: 44903
           Summary: /DISCARD/ section followed with a section with fill
                    expression will cause link failure for newer version
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedb...@nondot.org
          Reporter: yadong...@intel.com
                CC: llvm-bugs@lists.llvm.org, peter.sm...@linaro.org

When use newer version(>=9) of ld.lld, there will be link issue as below:
    ld.lld: error: linker.lds:14: malformed number: :
    >>>   /DISCARD/ :
    >>>

link script:
OUTPUT_FORMAT("elf64-x86-64","elf64-x86-64","elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)

ENTRY(main);

SECTIONS
{
  . = 0x10000;
  .text : { *(.text) }
  . = 0x8000000;
  .data : { *(.data) }
  .bss : { *(.bss) } =0x90909090

  /DISCARD/ :
  {
    *(.eh_frame)
  }
}

I have 2 ways to bypass the link issue:
  1. remove the fill expression " =0x90909090";
  2. add a section command before /DISCARD/, e.g.: ". = .;"

This issue only happens on newer version(>=9) of ld.lld, did not meet such
issue for old version.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to