- User Since
- Sep 4 2015, 4:18 PM (132 w, 3 d)
Sat, Mar 17
Fri, Mar 16
Use correct version of diff
Wed, Mar 14
I've fixed the typo in my commit message. I think either name is fine (or even update_clang_test_checks.py).
I just ran into this problem writing a test case and for now I used the workaround by @probinson but having a CHECK-EMPTY directive would make it much cleaner.
Just tested it and it works perfectly for me.
Tue, Mar 13
The reason that this is a MIPS test case is that I work on CHERI (which extends MIPS) and therefore most of the testcases I write are derived from MIPS input.
Fri, Mar 2
No need to revert, I think it is fine to improve the script in follow-up revisions. Thanks again for working on this!
LGTM, I guess the CHECK-LABEL thing can be fixed later.
LGTM but I guess someone else should approve
Turns out we can't emit R_MIPS_64 absolute relocations that don't need the GOT since neither glibc nor FreeBSD handle a R_MIPS_64 dynamic relocations.
If I have the following:
// RUN: %clang_cc1 -emit-llvm -o - %s -O2 | FileCheck %s
Thu, Mar 1
The FreeBSD rtld supports both so this LGTM. Emitting both is probably more compatible but I'm not sure it's required. What does ld.bfd do?
Added the correct version of the test
Wed, Feb 28
Thanks for working on this!
Tue, Feb 27
Mon, Feb 26
Thanks for working on this, it will make life a lot easier for us when it lands.
Fri, Feb 23
I can verify that without this patch pie executables crash inside the FreeBSD (CheriBSD) RTLD when processing DT_MIPS_RLD_MAP and with it they work.
Thu, Feb 22
Tue, Feb 20
It seems like changing all alloc sections to NOBITS is probably the correct way of doing this. So I guess D40523 adjusted to always keep the named debug sections is better.
I don't think any of them are SHF_ALLOC anyway but checking the names shouldn't do any harm.
Looks good once the IR parser accepts calls to non-AS0 pointers.
Mon, Feb 19
Feb 16 2018
Addressed review comment
Thank you very much for updating this patch! I have just made the switch in CheriBSD to completely stop using ld.bfd and so far everything I have tested is working.
Feb 15 2018
- Updated comments to Rafael's suggestions
Feb 14 2018
Shrink patch even more to address only the issue in the test case
Feb 12 2018
Since this is not the correct solution I'll just keep this in our fork.
The way it is currently it is emitting dynamic relocations into the .text segment. This needs -Wl,-z,notext with LLD but for BFD it will just emit those relocations anyway and (probably) crash at runtime.
At least now we are explicit that it requires a writable section (which will be in the relro section if you are using LLD).
Feb 10 2018
- Split out an unrelated change to D43161
- made the diff smaller
Feb 9 2018
Okay I won't bother submitting further improvements that actually allow us to run the test suite without crashing.
- address comments
- use mips for tests to avoid depending on llvm-mc changes
Your example will work for x86 and probably ARM, but as far as I can tell it is up to the ABI which calling convention should be used for functions without prototypes.
For us these calling conventions are incompatible since the variadic one will pass arguments on the stack instead of in registers so if the target function is not actually variadic this will cause it to read garbage from undefined registers. While it *should* work if there is only zero or one arguments it is not guaranteed to work with more than 1.
Feb 8 2018
Looks good to me but I guess someone else should approve the change.
Thank you very much for working on this. It will make our future upstream merges much easier.
Feb 3 2018
- Removed fried and renamed a method with the same name as the member but completely different semantics
- Removed default parameters
- Added comments
Feb 2 2018
Since the patch was committed change this to only a test case (depends on D42839)
Feb 1 2018
I have been working on adding RELA support to the mips rtld but this is quite annoying and will take a while. For now I have been able to run code just by setting Config->IsRela to false.
I originally discovered this issue because in our CHERI fork of LLD we set Config->IsRela = false when linking MIPS64 code. We do this because the FreeBSD MIPS rtld only understands Elf_Rel relocations and does not process Elf_Rela.
The dynamic symbol table is still included, it's only the PT_DYNAMIC, .dynamic and the _DYNAMIC symbol that are excluded.
Jan 31 2018
Jan 30 2018
Updated for review comments
- Made slightly more efficient by using std::partition instead of comparing in every loop iteration
Jan 28 2018
Calling K&R functions is not a problem. It is fine to use them as long as there is a declaration with the parameter types in the LLVM IR and not just an declare i32 @foo(...). The problem is that we are calling functions that don't have a declaration and therefore the compiler assumes that it is a variadic function call. This leads to runtime crashes on our CHERI platform.