#
2225d941 |
| 10-May-2016 |
Daniel Sanders <daniel.sanders@imgtec.com> |
[mips][ias] Make the default path unreachable in needsRelocateWithSymbol() (except for N64).
Following post-commit comments on r268900 from Rafael Espindola: The missing relocations are now explicit
[mips][ias] Make the default path unreachable in needsRelocateWithSymbol() (except for N64).
Following post-commit comments on r268900 from Rafael Espindola: The missing relocations are now explicitly listed in the switch statement with appropriate FIXME comments and the default path is now unreachable. The temporary exception to this is that compound relocations for N64 still have a default path that returns true. This is because fixing that case ought to be a separate patch.
Also make R_MIPS_NONE return false since it has no effect on the section data.
llvm-svn: 269047
show more ...
|
#
108823bc |
| 09-May-2016 |
Daniel Sanders <daniel.sanders@imgtec.com> |
[mips] Try to fix 'truncation from FindBestPredicateResult to bool' reported by MSVC
llvm-svn: 268928
|
#
3d000565 |
| 09-May-2016 |
Daniel Sanders <daniel.sanders@imgtec.com> |
[mips][ias] R_MIPS_(GOT|HI|LO|PC)16 and R_MIPS_GPREL32 do not need symbols.
Summary: In theory, care must be taken to ensure that pairs of R_MIPS_(GOT|HI|LO)16 make the same decision on both relocs
[mips][ias] R_MIPS_(GOT|HI|LO|PC)16 and R_MIPS_GPREL32 do not need symbols.
Summary: In theory, care must be taken to ensure that pairs of R_MIPS_(GOT|HI|LO)16 make the same decision on both relocs in the reloc pair but in practice this isn't as hard as it sounds and only limits the complexity of the predicate used. We handle all three with the same code to ensure their decisions always agree with each other.
Reviewers: sdardis
Subscribers: rafael, dsanders, sdardis, llvm-commits
Differential Revision: http://reviews.llvm.org/D19016
llvm-svn: 268900
show more ...
|
#
77edc2ef |
| 07-May-2016 |
NAKAMURA Takumi <geek4civic@gmail.com> |
MipsELFObjectWriter.cpp: Activate debug printer just for +Asserts. [-Wunused-function]
llvm-svn: 268848
|
#
a463d31a |
| 06-May-2016 |
Daniel Sanders <daniel.sanders@imgtec.com> |
[mips] Correct the ordering of HI/LO pairs in the relocation table.
Summary: There seems to have been a misunderstanding as to the meaning of 'offset' in the rules laid down by our ABI. The previous
[mips] Correct the ordering of HI/LO pairs in the relocation table.
Summary: There seems to have been a misunderstanding as to the meaning of 'offset' in the rules laid down by our ABI. The previous code believed that 'offset' meant the offset within the section that the relocation is applied to. However, it should have meant the offset from the symbol used in the relocation expression.
This patch adds two fields to ELFRelocationEntry and uses them to correct the order of relocations for MIPS. These fields contain: * The original symbol before shouldRelocateWithSymbol() is considered. This ensures that R_MIPS_GOT16 is able to correctly distinguish between local and external symbols, allowing us to tell whether %got() requires a matching %lo() or not (local symbols require one, external symbols don't). It also prevents confusing cases where the fuzzy matching rules cause things like %hi(foo)/%lo(foo+3) and %hi(bar)/%lo(bar+1) to swap their %lo()'s. * The original offset before shouldRelocateWithSymbol() is considered. The existing Addend field is always zero when the object uses in place addends (because it's already moved it to the encoding) but MIPS needs to use the original offset to ensure that the linker correctly calculates the carry-in bit for %hi() and %got().
IAS ensures that unmatchable %hi()/%got() relocations are placed at the end of the table to ensure that the linker rejects the table (we're unable to report such errors directly). The alternatives to this risk accidental matching against inappropriate relocations which may silently compute incorrect values due to an incorrect carry bit between the %lo() and %hi()/%got().
Reviewers: sdardis
Subscribers: dsanders, sdardis, rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D19718
llvm-svn: 268733
show more ...
|
#
fe98b2f5 |
| 03-May-2016 |
Daniel Sanders <daniel.sanders@imgtec.com> |
[mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.
Summary: This is much closer to the way MIPS relocation expressions work (%hi(foo + 2) rather than %hi(foo) + 2) and removes the
[mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.
Summary: This is much closer to the way MIPS relocation expressions work (%hi(foo + 2) rather than %hi(foo) + 2) and removes the need for the various bodges in MipsAsmParser::evaluateRelocExpr().
Removing those bodges ensures that the constant stored in MCValue is the full 32 or 64-bit (depending on ABI) offset from the symbol. This will be used to correct the %hi/%lo matching needed to sort the relocation table correctly.
As part of this: * Gave MCExpr::print() the ability to omit parenthesis when emitting a symbol reference inside a MipsMCExpr operator like %hi(X). Without this we print things like %lo(($L1)). * %hi(%neg(%gprel(X))) is now three MipsMCExpr's instead of one. Most of the related special cases have been removed or moved to MipsMCExpr. We can remove the rest as we gain support for the less common relocations when they are not part of this specific combination. * Renamed MipsMCExpr::VariantKind and the enum prefix ('VK_') to avoid confusion with MCSymbolRefExpr::VariantKind and its prefix (also 'VK_'). * fixup_Mips_GOT_Local and fixup_Mips_GOT_Global were found to be identical and merged into fixup_Mips_GOT. * MO_GOT16 and MO_GOT turned out to be identical and have been merged into MO_GOT. * VK_Mips_GOT and VK_Mips_GOT16 turned out to be the same thing so they have been merged into MEK_GOT
Reviewers: sdardis
Subscribers: dsanders, sdardis, llvm-commits
Differential Revision: http://reviews.llvm.org/D19716
llvm-svn: 268379
show more ...
|
#
8e366822 |
| 22-Apr-2016 |
Zoran Jovanovic <zoran.jovanovic@imgtec.com> |
[mips][microMIPS] Add R_MICROMIPS_PC18_S3 relocation
Differential Revision: http://reviews.llvm.org/D15026
llvm-svn: 267130
|
#
6764fa78 |
| 21-Apr-2016 |
Zoran Jovanovic <zoran.jovanovic@imgtec.com> |
[mips][microMIPS] Add R_MICROMIPS_PC19_S2 relocation
Differential Revision: http://reviews.llvm.org/D14915
llvm-svn: 266988
|
#
02b70030 |
| 21-Apr-2016 |
Zoran Jovanovic <zoran.jovanovic@imgtec.com> |
[mips][microMIPS] Add R_MICROMIPS_PC26_S1 relocation
Differential Revision: http://reviews.llvm.org/D14822
llvm-svn: 266985
|
#
b550cb17 |
| 18-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
[NFC] Header cleanup
Removed some unused headers, replaced some headers with forward class declarations.
Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedM
[NFC] Header cleanup
Removed some unused headers, replaced some headers with forward class declarations.
Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap'
Patch by Eugene Kosov <claprix@yandex.ru>
Differential Revision: http://reviews.llvm.org/D19219
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
show more ...
|
Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3 |
|
#
d1aeb056 |
| 15-Feb-2016 |
Scott Egerton <Scott.Egerton@imgtec.com> |
[mips] Implemented the .hword directive.
Summary: In order to pass the tests, this required marking R_MIPS_16 relocations as needing to point to the symbol and not the section.
Reviewers: vkalintir
[mips] Implemented the .hword directive.
Summary: In order to pass the tests, this required marking R_MIPS_16 relocations as needing to point to the symbol and not the section.
Reviewers: vkalintiris, dsanders
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D17200
llvm-svn: 260896
show more ...
|
Revision tags: llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1 |
|
#
c897cdde |
| 14-Jan-2016 |
Rafael Espindola <rafael.espindola@gmail.com> |
Handle offsets larger than 32 bits.
David Majnemer noticed that it was not obvious what the behavior would be if B.Offset - A.Offset could not fit in an int.
llvm-svn: 257803
|
#
56cb2734 |
| 14-Jan-2016 |
Rafael Espindola <rafael.espindola@gmail.com> |
Assert that a cmp function defines a total order.
Thanks to David Blaikie for noticing it.
llvm-svn: 257796
|
#
8340f94d |
| 13-Jan-2016 |
Rafael Espindola <rafael.espindola@gmail.com> |
Convert a few assert failures into proper errors.
Fixes PR25944.
llvm-svn: 257697
|
#
f44db24e |
| 17-Dec-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Avoid explicit relocation sorting most of the time.
These days relocations are created and stored in a deterministic way. The order they are created is also suitable for the .o file, so we don't nee
Avoid explicit relocation sorting most of the time.
These days relocations are created and stored in a deterministic way. The order they are created is also suitable for the .o file, so we don't need an explicit sort.
The last remaining exception is MIPS.
llvm-svn: 255902
show more ...
|
#
d0e16522 |
| 17-Dec-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Always sort by offset first. NFC.
Every target changing sortRelocs was first calling the parent implementation. Just run that first.
llvm-svn: 255898
|
Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
9f6ad497 |
| 12-Nov-2015 |
Daniel Sanders <daniel.sanders@imgtec.com> |
Implement .reloc (constant offset only) with support for R_MIPS_NONE and R_MIPS_32.
Summary: Support for R_MIPS_NONE allows us to parse MIPS16's usage of .reloc. R_MIPS_32 was included to be able to
Implement .reloc (constant offset only) with support for R_MIPS_NONE and R_MIPS_32.
Summary: Support for R_MIPS_NONE allows us to parse MIPS16's usage of .reloc. R_MIPS_32 was included to be able to better test the directive.
Targets can add their relocations by overriding MCAsmBackend::getFixupKind().
Subscribers: grosbach, rafael, majnemer, dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D13659
llvm-svn: 252888
show more ...
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1 |
|
#
f00654e3 |
| 23-Jun-2015 |
Alexander Kornienko <alexfh@google.com> |
Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.
llvm-svn: 240390
|
#
70bc5f13 |
| 19-Jun-2015 |
Alexander Kornienko <alexfh@google.com> |
Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-c
Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/
Thanks to Eugene Kosov for the original patch!
llvm-svn: 240137
show more ...
|
#
58405d85 |
| 16-Jun-2015 |
Daniel Sanders <daniel.sanders@imgtec.com> |
[mips][ias] Expand on r238751 to cover as many relocs as possible.
Summary: Relocs that can be converted from absolute to PC-relative now do so if IsPCRel is true. Relocs that require PC-relative no
[mips][ias] Expand on r238751 to cover as many relocs as possible.
Summary: Relocs that can be converted from absolute to PC-relative now do so if IsPCRel is true. Relocs that require PC-relative now call llvm_unreachable() if IsPCRel is false and similarly those that require absolute assert that IsPCRel is false.
Note that while it looks like some relocs (e.g. R_MIPS_26) can be converted into the MIPS32r6/MIPS64r6 relocs (R_MIPS_PC*_S2), it isn't actually valid to do so.
Placeholders have been left in the testcase for unsupported relocs and relocs that cannot be generated at the moment.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits, rafael
Differential Revision: http://reviews.llvm.org/D10184
llvm-svn: 239817
show more ...
|
#
8c006ee3 |
| 04-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Bring back r239006 with a fix.
The fix is just that getOther had not been updated for packing the st_other values in fewer bits and could return spurious values:
- unsigned Other = (getFlags() & (
Bring back r239006 with a fix.
The fix is just that getOther had not been updated for packing the st_other values in fewer bits and could return spurious values:
- unsigned Other = (getFlags() & (0x3f << ELF_STO_Shift)) >> ELF_STO_Shift; + unsigned Other = (getFlags() & (0x7 << ELF_STO_Shift)) >> ELF_STO_Shift;
Original message:
Pack the MCSymbolELF bit fields into MCSymbol's Flags.
This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64.
While at it, also make getOther/setOther easier to use by accepting unshifted STO_* values.
llvm-svn: 239012
show more ...
|
#
a86ecee5 |
| 04-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Revert "Pack the MCSymbolELF bit fields into MCSymbol's Flags."
This reverts commit r239006.
I am debugging the powerpc failures.
llvm-svn: 239010
|
#
d31203ae |
| 04-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Pack the MCSymbolELF bit fields into MCSymbol's Flags.
This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64.
While at it, also make getOther/setOther easier to use by accepting unshifted ST
Pack the MCSymbolELF bit fields into MCSymbol's Flags.
This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64.
While at it, also make getOther/setOther easier to use by accepting unshifted STO_* values.
llvm-svn: 239006
show more ...
|
#
95fb9b93 |
| 02-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Merge MCELF.h into MCSymbolELF.h.
Now that we have a dedicated type for ELF symbol, these helper functions can become member function of MCSymbolELF.
llvm-svn: 238864
|
#
7f7caf91 |
| 01-Jun-2015 |
Rafael Espindola <rafael.espindola@gmail.com> |
Fix relocation selection for foo-. on mips.
This handles only the 32 bit case.
llvm-svn: 238751
|