[NFC][XCOFF] Use common function to calculate file offset
authorJake Egan <5326451+jakeegan@users.noreply.github.com>
Wed, 19 Jul 2023 02:08:46 +0000 (22:08 -0400)
committerJake Egan <5326451+jakeegan@users.noreply.github.com>
Wed, 19 Jul 2023 02:08:56 +0000 (22:08 -0400)
commitecbc812e0ccaa6d969bb8ee672bc5146cad3d757
treef0c8bfe16821004f3065f53f7b9b327f1ec9ec0c
parentc4a5b58497677f6be2618765f89b08462e820337
[NFC][XCOFF] Use common function to calculate file offset

The file offset code is repeated in nearly identical form for every derivation of SectionEntry, so make it into a method in SectionEntry instead.

Reviewed By: scott.linder

Differential Revision: https://reviews.llvm.org/D155199
llvm/lib/MC/XCOFFObjectWriter.cpp