summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-05-31 22:46:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-05-31 22:46:19 +0000
commitcccd2c604e4600feb108c51839fc82f7933fc759 (patch)
tree11bb98165fbe1e108f5cd365b6e59bd67162430c
parentfc7ba565ed32b972a58e62ddd864e7e84eeb2977 (diff)
downloadbcm5719-llvm-cccd2c604e4600feb108c51839fc82f7933fc759.tar.gz
bcm5719-llvm-cccd2c604e4600feb108c51839fc82f7933fc759.zip
Merge two nested ifs. NFC.
llvm-svn: 304368
-rw-r--r--lld/ELF/Writer.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 20f86f0f212..adc606049eb 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1694,17 +1694,15 @@ template <class ELFT> void Writer<ELFT>::fixPredefinedSymbols() {
// Setup MIPS _gp_disp/__gnu_local_gp symbols which should
// be equal to the _gp symbol's value.
- if (Config->EMachine == EM_MIPS) {
- if (!ElfSym::MipsGp->Value) {
- // Find GP-relative section with the lowest address
- // and use this address to calculate default _gp value.
- uint64_t Gp = -1;
- for (const OutputSection *OS : OutputSections)
- if ((OS->Flags & SHF_MIPS_GPREL) && OS->Addr < Gp)
- Gp = OS->Addr;
- if (Gp != (uint64_t)-1)
- ElfSym::MipsGp->Value = Gp + 0x7ff0;
- }
+ if (Config->EMachine == EM_MIPS && !ElfSym::MipsGp->Value) {
+ // Find GP-relative section with the lowest address
+ // and use this address to calculate default _gp value.
+ uint64_t Gp = -1;
+ for (const OutputSection *OS : OutputSections)
+ if ((OS->Flags & SHF_MIPS_GPREL) && OS->Addr < Gp)
+ Gp = OS->Addr;
+ if (Gp != (uint64_t)-1)
+ ElfSym::MipsGp->Value = Gp + 0x7ff0;
}
}
OpenPOWER on IntegriCloud