This is an archive of the discontinued LLVM Phabricator instance.

Set non alloc section address to 0 earlier
ClosedPublic

Authored by rafael on Jun 12 2017, 4:34 PM.

Details

Reviewers
ruiu
Summary

Currently we do layout as if non alloc sections had an actual address and then set it to zero. This produces a few odd results where a symbol has an address that is inconsistent with the section address.

The simplest way to fix it is probably to just set the address earlier.

The behavior of bfd seems to be similar, but it only sets the non alloc section address if the section is missing from the linker script or if the script has an explicit " : 0" setting the address of the output section (which the default script does).

Diff Detail

Event Timeline

rafael created this revision.Jun 12 2017, 4:34 PM
rafael edited the summary of this revision. (Show Details)Jun 12 2017, 4:35 PM
rafael edited the summary of this revision. (Show Details)
ruiu accepted this revision.Jun 13 2017, 12:56 PM

LGTM

This revision is now accepted and ready to land.Jun 13 2017, 12:56 PM
espindola closed this revision.Mar 14 2018, 4:02 PM
espindola added a subscriber: espindola.

r305323