[llvm-bugs] [Bug 46263] New: The lld cannot identify LMA overlapping when the VMA is not specified.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 9 21:14:30 PDT 2020


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

            Bug ID: 46263
           Summary: The lld cannot identify LMA overlapping when the VMA
                    is not specified.
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: 2077213809 at qq.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

I used the latest lld and one of the versions of lld and found that the latest
version had a problem.

MEMORY  {
  DDR : o = 0xfb00000, l = 185M
  TCM : o = 0x1F400000, l = 128K
}

SECTIONS {
  .text 0xfb00000 : {
    * (.text);
    _etext = .;
   } > DDR
  .mdata : AT(LOADADDR(.text) + SIZEOF(.text)) {
    _data = .;
    *(.data);
    _edata = .;
  } > TCM
  .bss : { // This is not reasonable because the LMA of .bss overlaps that of
.mdata.
    _bstart = .;
    *(.bss) * (COMMON);
    _bend = .;
  } > DDR
  .ARM.exidx : {
    *(.ARM.exidx);
  } > DDR
}

// The latest linker. from https://github.com/llvm/llvm-project Source code
compilation

ld.lld -T my.ld test.o
objdump -hw a.out

## the .bss LMA is a Strange numbers.

Idx Name          Size      VMA       LMA       File off  Algn  Flags
  0 .text         00000008  0fb00000  0fb00000  00001000  2**2  CONTENTS,
ALLOC, LOAD, READONLY, CODE
  1 .mdata        00000004  1f400000  0fb00008  00002000  2**2  CONTENTS,
ALLOC, LOAD, DATA
  2 .bss          00000008  0fb00008  00200010  00002004  2**2  ALLOC
  3 .ARM.exidx    00000010  0fb00010  00200018  00002010  2**2  CONTENTS,
ALLOC, LOAD, READONLY, DATA
  4 .comment      000000bc  00000000  00000000  00002020  2**0  CONTENTS,
READONLY
  5 .ARM.attributes 0000003e  00000000  00000000  000020dc  2**0  CONTENTS,
READONLY

// one of version lld. The overlap can be identified.
//./ld.lld -v
//LLD 11.0.0 (https://github.com/llvm/llvm-project.git
07d68c24aa19483e44db4336b0935b00a5d69949) (compatible with GNU linkers)

ld.lld -T gcc.ld test.o
ld.lld: warning: lld uses blx instruction, no object with architecture
supporting feature detected
ld.lld: error: section .mdata load address range overlaps with .bss
>>> .mdata range is [0xFB00008, 0xFB0000B]
>>> .bss range is [0xFB00008, 0xFB0000F]

-- 
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/20200610/e5c25cd3/attachment.html>


More information about the llvm-bugs mailing list