[PATCH] D23505: [ELF] - Linkrscript: change the way of creating PT_LOADs segments when LS is used.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 03:38:17 PDT 2016


grimar added a comment.

In https://reviews.llvm.org/D23505#516296, @evgeny777 wrote:

> If it were just some ELF binary it would work fine.
>  Does FreeBSD bootloader require segments to start on page boundary? Did you check this?


Nope. Why some binary would work fine ?

  Type           Offset             VirtAddr           PhysAddr
                   FileSiz            MemSiz              Flags  Align
  LOAD           0x00000000000e4110 0xffffffff800e5110 0xffffffff800e5110
                  0x0000000000ba2b0c 0x0000000000ba2b0c  R E    1000
  LOAD           0x0000000000c86c20 0xffffffff80c87c20 0xffffffff80c87c20
                  0x000000000038ab28 0x000000000038ab28  R      1000

End of first load is :
0xffffffff800e5110 + 0x0000000000ba2b0c = FFFFFFFF80C87C1C

It shares the same memory page with the second load at 0xffffffff80c87c20,
though they have different access attributes.

Should this really work fine ?


https://reviews.llvm.org/D23505





More information about the llvm-commits mailing list