Tidy up address and file offset assignments in the Writer.
authorRui Ueyama <ruiu@google.com>
Fri, 1 Apr 2016 17:07:17 +0000 (17:07 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 1 Apr 2016 17:07:17 +0000 (17:07 +0000)
commite044e9cf80236c85e93b40e274b067e6f9dbaf39
tree7df767b8576d93b50d3765eb7de1ddb3229debe1
parent790db9c458df76e40e6eeabc79a131ac545312df
Tidy up address and file offset assignments in the Writer.

assignAddressesRelocatable function did not set addresses to sections
despite its name. What it actually did is to set file offsets to sections.
assignAddresses function assigned addresses and file offsets to sections.
So there was a confusion what they were doing, and they had duplicate code.

This patch separates file offset assignments from address assignments.
A new function, assignFileOffsets assign file offsets. assignAddresses
do not care about file offsets anymore.

llvm-svn: 265151
lld/ELF/Writer.cpp