[llvm-bugs] [Bug 38776] New: LMA/VMA issue on ARMv7 bare metal

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 30 08:23:30 PDT 2018


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

            Bug ID: 38776
           Summary: LMA/VMA issue on ARMv7 bare metal
           Product: lld
           Version: unspecified
          Hardware: Other
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: eblot.ml at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi,

This might be a follow up of https://bugs.llvm.org/show_bug.cgi?id=34407.

Using the same environment, using clang/LLVM 7.0.0-rc2, it seems LLD has
another trouble with LMA.

Using a similar LD script:

MEMORY
{
  FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
  RAM (rwx) :  ORIGIN = 0x200014b8, LENGTH = 0xeb48
}

ENTRY(Reset_Handler)

SECTIONS
{

    .text :
    {
    }  > FLASH

    /* ... other sections that go to FLASH region */

    __etext = .;

    .data : AT (__etext)
    {
        __data_start__ = .;
        *(.data*)
    } > RAM

    /* ... other sections that go to RAM region */
}

the ld.lld ELF output produces something unexpected:

$ arm-none-eabi-nm powernode/powernode.elf | egrep -e '__etext|__data_start'
200014b8 D __data_start__
00069f8c R __etext

$ arm-none-eabi-objdump -h powernode/powernode.elf | egrep -e '\.data|Idx'
Idx Name          Size      VMA       LMA       File off  Algn
 21 .data         0000082c  200014b8  200014b8  00112550  2**3

I would have expected .data LMA to be 00069f8c, *not* 200014b8



A weird thing is that with another version of the same project, using the same
compilation suite (7.0.0-rc2) and the same linker script, the output is as
expected:

$ arm-none-eabi-nm powernode/powernode.elf | egrep -e '__etext|__data_start'
20002400 D __data_start__
00060c08 R __etext

$ arm-none-eabi-objdump -h powernode/powernode.elf | egrep -e '\.data|Idx'
Idx Name          Size      VMA       LMA       File off  Algn
  8 .data         00000820  20002400  00060c08  0003f400  2**3


I can provide a repro tar file, but I'd like it not to be publicly available if
possible. Any way to do this?

-- 
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/20180830/2f24766a/attachment.html>


More information about the llvm-bugs mailing list