[llvm-bugs] [Bug 38749] New: [Linker script] forward reference

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 28 17:04:45 PDT 2018


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

            Bug ID: 38749
           Summary: [Linker script] forward reference
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: pshung807 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Can lld support forward reference to a section which is mentioned after?
At line 4, _text_start refers to .bss which is specified after and expected
value is 0x4000.
This feature is supported by bfd linker.


  1 # REQUIRES: x86
  2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
  3 # RUN: echo "SECTIONS {       \
  4 # RUN:  _text_start = LOADADDR(.bss);   \
  5 # RUN:  .text : { *(.text) }  \
  6 # RUN: . = 0x4000;     \
  7 # RUN:  .bss : { *(.bss) }  \
  8 # RUN: }" > %t.script
  9 # RUN: ld.lld -o %t1 --script %t.script %t
 10 # RUN: llvm-objdump -t %t1 | FileCheck %s
 11
 12 .text
 13 nop
 14 nop
 15 .section .bss, "aw", at nobits
 16  .quad 0
 17 # CHECK: 0000000000004000         *ABS*           00000000 _text_start

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180829/3dc6e78c/attachment.html>


More information about the llvm-bugs mailing list