This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Linkerscript: implemented LOADADDR()
AbandonedPublic

Authored by grimar on Sep 26 2016, 5:37 AM.

Details

Reviewers
ruiu
rafael
Summary

Met that commind used in the wild, for example here:
https://searchcode.com/file/51551302/arch/x86_64/kernel/vmlinux.lds.S

LOADADDR(section)
  Return the absolute LMA of the named section. This is normally the same as
  ADDR, but it may be different if the AT attribute is used in the output section
  definition.

Diff Detail

Event Timeline

grimar updated this revision to Diff 72470.Sep 26 2016, 5:37 AM
grimar retitled this revision from to [ELF] - Linkerscript: implemented LOADADDR().
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar updated this object.
grimar added subscribers: llvm-commits, grimar, evgeny777.
evgeny777 added inline comments.Sep 26 2016, 5:43 AM
ELF/LinkerScript.cpp
732

Looks like this is not correct.
From https://sourceware.org/binutils/docs-2.20/ld/Output-Section-LMA.html

If neither AT nor AT> is specified for an allocatable section, the linker will set the LMA such that the difference between VMA and LMA for the section is the same as the preceding output section in the same region

grimar abandoned this revision.Sep 26 2016, 5:47 AM

Ah, I missed we have one on review :(