Page MenuHomePhabricator

arichardson (Alexander Richardson)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 4 2015, 4:18 PM (214 w, 5 d)

Recent Activity

Wed, Oct 9

arichardson added a comment to D68146: [FileCheck] Implement --ignore-case option..

LGTM

Wed, Oct 9, 6:42 AM · Restricted Project

Mon, Oct 7

arichardson added a comment to D68542: [Mips] Always save RA when disabling frame pointer elimination.

I don't think you can have frame-pointer based stack unwinding under current Mips ABIs, albeit this might be useful for some stack scan based unwind. Not sure tho.

You can most of the time, you just have to scan backwards to find the function prologue. Yes, it can break, but unless you have full DWARF info you can't do much better. Both FreeBSD (sys/mips/mips/db_trace.c) and Linux (arch/mips/kernel/process.c) do instruction-based unwinding on MIPS to get a good-enough backtrace on panic, so without this they can end up terminating the backtrace early. In particular, if you want a specific instance of the issue that motivated this patch, on FreeBSD, they have a panic which calls vpanic (much like printf vs vprintf), but due to being marked noreturn, $ra is dead and thus being clobbered by the call doesn't force a save like normal, so *every* panic ends up with a useless backtrace terminating at panic.

Mon, Oct 7, 10:09 AM · Restricted Project

Tue, Oct 1

arichardson added a comment to D68275: [libcxx] [test] Query the target platform, not the host one.

Looks good to me but I'm not sure about the PATH changes.

Tue, Oct 1, 11:51 AM · Restricted Project

Mon, Sep 30

arichardson added inline comments to D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned).
Mon, Sep 30, 11:18 AM · Restricted Project, Restricted Project
arichardson added inline comments to D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned).
Mon, Sep 30, 6:41 AM · Restricted Project, Restricted Project

Wed, Sep 18

Herald added a project to D49091: Warn about usage of __has_include/__has_include_next in macro expansions: Restricted Project.

Ping? I'm not sure if this is still required now that D63508 has been committed?

Wed, Sep 18, 2:21 PM · Restricted Project
arichardson accepted D66795: [Mips] Use appropriate private label prefix based on Mips ABI.

Looks good to me but I guess someone else should give the final approval.

Wed, Sep 18, 10:49 AM · Restricted Project, Restricted Project, Restricted Project

Tue, Sep 17

arichardson added inline comments to D67649: [FileCheck] Move private interface to its own header.
Tue, Sep 17, 2:16 AM · Restricted Project

Sep 3 2019

arichardson committed rL370820: Fix error in last commit.
Fix error in last commit
Sep 3 2019, 2:02 PM
arichardson committed rL370819: Request commit access for arichardson.
Request commit access for arichardson
Sep 3 2019, 1:57 PM

Aug 28 2019

arichardson committed rG83d2f0e7993a: Further relax checks in asan-symbolize-bad-path.cpp (authored by arichardson).
Further relax checks in asan-symbolize-bad-path.cpp
Aug 28 2019, 11:38 AM
arichardson committed rL370243: Further relax checks in asan-symbolize-bad-path.cpp.
Further relax checks in asan-symbolize-bad-path.cpp
Aug 28 2019, 11:37 AM

Aug 27 2019

arichardson added a comment to D66141: [FileCheck] Forbid using var defined on same line.

LGTM except for one minor issue.

Hi Alexander,

Was your intention to approve the patch or did you intentionally leave it to others to approve?

Best regards.

Aug 27 2019, 2:20 PM · Restricted Project
arichardson committed rL370110: Fix asan-symbolize-bad-path.cpp on Darwin.
Fix asan-symbolize-bad-path.cpp on Darwin
Aug 27 2019, 2:19 PM
arichardson committed rG79f3459deb70: Fix asan-symbolize-bad-path.cpp on Darwin (authored by arichardson).
Fix asan-symbolize-bad-path.cpp on Darwin
Aug 27 2019, 2:14 PM
arichardson added a comment to D66795: [Mips] Use appropriate private label prefix based on Mips ABI.

Would it be possible to require a const MCTargetOptions &Options when creating MCAsmInfo?
If MCTargetOptions isn't always available, how about passing an Optional<MCTargetOptions> to MCAsmInfo? That would be equivalent to the current approach but make it harder to forget calling adjustPrefixes()

That would look something like this https://reviews.llvm.org/differential/diff/217420/ . I've already tested this solution earlier (except using Optional<>) but decided against it because of changes to MCAsmInfo for every target. Yes, the advantage is that it would be harder to forget about 'adjustPrefixes()' vs some more changes in code. Let me know which way you prefer.

Aug 27 2019, 10:05 AM · Restricted Project, Restricted Project, Restricted Project
arichardson added a comment to D66795: [Mips] Use appropriate private label prefix based on Mips ABI.
  • adjustPrefixes() is not called after every call of createMCAsmInfo(), only where MCTargetOptions is available since this is what tells us if ABI is given as argument.
  • StringRef CPU could be removed from adjustPrefixes() since MipsABIInfo::computeTargetABI() does not use it in it's implementation and an empty string could be passed. We could remove Triple as well and use MCTargetOptions.ABIName only and read it manualy, but this way we would keep it consistent with other uses of MipsABIInfo.
Aug 27 2019, 4:39 AM · Restricted Project, Restricted Project, Restricted Project
arichardson committed rL370025: [asan_symbolize] Fix broken pipe handling for python 2.7.
[asan_symbolize] Fix broken pipe handling for python 2.7
Aug 27 2019, 12:36 AM
arichardson committed rG677c6ddd33da: [asan_symbolize] Fix broken pipe handling for python 2.7 (authored by arichardson).
[asan_symbolize] Fix broken pipe handling for python 2.7
Aug 27 2019, 12:31 AM
arichardson abandoned D42748: [ELF] Don't create a .dynamic section when linking with -Bstatic.

FreeBSD libc should be fixed instead.

Aug 27 2019, 12:27 AM · Restricted Project
arichardson added a comment to D65322: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line.

I believe I fixed this problem in https://reviews.llvm.org/rL369929

It seems like address %t+0x0 is valid on that builder. Maybe it defaults to -pie. Should be fixable by using an address that is more likely to be invalid.

But it's still a problem in python code which is not going to work on on python 2.7

Aug 27 2019, 12:05 AM · Restricted Project, Restricted Project
arichardson committed rL370021: Relax test introduced in D65322.
Relax test introduced in D65322
Aug 27 2019, 12:03 AM
arichardson committed rG23a12fc3ac4b: Relax test introduced in D65322 (authored by arichardson).
Relax test introduced in D65322
Aug 27 2019, 12:02 AM

Aug 26 2019

arichardson added a comment to D65322: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line.

I believe I fixed this problem in https://reviews.llvm.org/rL369929

Aug 26 2019, 11:42 PM · Restricted Project, Restricted Project
arichardson committed rL369929: [asan_symbolize] Attempt to fix build-bot failure after latest change.
[asan_symbolize] Attempt to fix build-bot failure after latest change
Aug 26 2019, 2:13 PM
arichardson committed rG2511b5a4638a: [asan_symbolize] Attempt to fix build-bot failure after latest change (authored by arichardson).
[asan_symbolize] Attempt to fix build-bot failure after latest change
Aug 26 2019, 10:23 AM
arichardson committed rL369924: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line.
[asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line
Aug 26 2019, 9:33 AM
arichardson committed rGe320db434ed1: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line (authored by arichardson).
[asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line
Aug 26 2019, 9:30 AM
arichardson closed D65322: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line.
Aug 26 2019, 9:26 AM · Restricted Project, Restricted Project

Aug 23 2019

arichardson accepted D66640: [FileCheck] Make NumericVariable ctor explicit.
Aug 23 2019, 8:21 AM · Restricted Project

Aug 22 2019

arichardson added a comment to D65322: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line.

Ping? This breaks unit test when building with -DLLVM_INSTALL_BINUTILS_SYMLINKS=ON

Aug 22 2019, 3:33 PM · Restricted Project, Restricted Project
arichardson added a comment to D66141: [FileCheck] Forbid using var defined on same line.

LGTM except for one minor issue.

Aug 22 2019, 8:33 AM · Restricted Project

Aug 19 2019

arichardson added a comment to D66274: [ELF][Hexagon] Replace R_HEXAGON_GOT with R_GOTPLT.

Nice! Thank you for doing this.

The remaining bits of RelExpr are a scarce recourse now... R_RISCV_PC_INDIRECT == 61. @sidneym Do you need more than 3 bits?

It shouldn't be too hard to extend oneOf so that the function uses two words instead of one word as a bitmap, but yeah, we should first try to reduce the number of relocation types if possible.

Aug 19 2019, 2:17 AM · Restricted Project

Aug 9 2019

arichardson accepted D65772: Add support for FreeBSD's LD_32_LIBRARY_PATH.

LGTM. This reduces the check-asan-dynamic test failures from 209 to 50 if I also apply the -pthread patch.

Aug 9 2019, 9:06 AM · Restricted Project, Restricted Project

Aug 6 2019

arichardson committed rG0b168ffdc3ff: [TSAN] Fix tsan on FreeBSD after D54889 (authored by arichardson).
[TSAN] Fix tsan on FreeBSD after D54889
Aug 6 2019, 3:31 PM
arichardson committed rL368103: [TSAN] Fix tsan on FreeBSD after D54889.
[TSAN] Fix tsan on FreeBSD after D54889
Aug 6 2019, 3:31 PM
arichardson closed D65705: [TSAN] Fix tsan on FreeBSD after D54889.
Aug 6 2019, 3:30 PM · Restricted Project, Restricted Project

Aug 3 2019

arichardson created D65705: [TSAN] Fix tsan on FreeBSD after D54889.
Aug 3 2019, 3:02 PM · Restricted Project, Restricted Project

Jul 31 2019

arichardson committed rGa4ea27de9287: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD (authored by arichardson).
[Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD
Jul 31 2019, 9:33 AM
arichardson committed rL367442: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
[Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD
Jul 31 2019, 9:32 AM
arichardson closed D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 31 2019, 9:32 AM · Restricted Project, Restricted Project
arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.

Move the cast to dlsym() return value rather than the function pointer call

Jul 31 2019, 2:17 AM · Restricted Project, Restricted Project
arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.

Used decltype now. Should be a bit shorter than the using declaration.
I still need the casts, otherwise the build fails when building the i368 RTSanitizerCommon.i386.dir/sanitizer_linux.cc.o:

/exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:786:57: error: cannot initialize a parameter of type 'size_t *' (aka 'unsigned int *') with an lvalue of type '__sanitizer::uptr *' (aka 'unsigned long *')
Jul 31 2019, 1:16 AM · Restricted Project, Restricted Project

Jul 30 2019

arichardson added inline comments to D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 30 2019, 1:16 PM · Restricted Project, Restricted Project

Jul 29 2019

arichardson added a reviewer for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD: Restricted Project.
Jul 29 2019, 7:36 AM · Restricted Project, Restricted Project

Jul 28 2019

arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.

Remove mention of FreeBSD from comment

Jul 28 2019, 3:07 AM · Restricted Project, Restricted Project
arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.

git-clang-format

Jul 28 2019, 3:06 AM · Restricted Project, Restricted Project

Jul 27 2019

arichardson committed rG51bfb84852e5: [compiler-rt] Fix running tests on macOS when XCode is not installed (authored by arichardson).
[compiler-rt] Fix running tests on macOS when XCode is not installed
Jul 27 2019, 5:33 AM
arichardson committed rL367170: [compiler-rt] Fix running tests on macOS when XCode is not installed.
[compiler-rt] Fix running tests on macOS when XCode is not installed
Jul 27 2019, 5:32 AM
arichardson closed D65323: [compiler-rt] Fix running tests on macOS when XCode is not installed.
Jul 27 2019, 5:32 AM · Restricted Project, Restricted Project

Jul 26 2019

arichardson retitled D65323: [compiler-rt] Fix running tests on macOS when XCode is not installed from If XCode is not installed, `xcodebuild -version -sdk macosx Path` will give xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance In this case... to [compiler-rt] Fix running tests on macOS when XCode is not installed.
Jul 26 2019, 12:52 PM · Restricted Project, Restricted Project
arichardson updated the diff for D65323: [compiler-rt] Fix running tests on macOS when XCode is not installed.

Always use xcrun

Jul 26 2019, 12:52 PM · Restricted Project, Restricted Project
arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.

Use the more portable dlsym() instead of dlfunc()

Jul 26 2019, 12:44 PM · Restricted Project, Restricted Project
arichardson added inline comments to D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 26 2019, 3:21 AM · Restricted Project, Restricted Project
arichardson added inline comments to D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 26 2019, 3:17 AM · Restricted Project, Restricted Project
arichardson added inline comments to D60390: FileCheck [10/12]: Add support for signed numeric values.
Jul 26 2019, 2:59 AM · Restricted Project
arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
  • Address review feedback
  • Remove XFAIL: freebsd from another test that now passes
Jul 26 2019, 2:47 AM · Restricted Project, Restricted Project
arichardson added inline comments to D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 26 2019, 2:43 AM · Restricted Project, Restricted Project
arichardson updated the summary of D65323: [compiler-rt] Fix running tests on macOS when XCode is not installed.
Jul 26 2019, 1:52 AM · Restricted Project, Restricted Project
arichardson updated the diff for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.

Remove freebsd XFAIL from two tests that pass with this change

Jul 26 2019, 1:40 AM · Restricted Project, Restricted Project
arichardson created D65323: [compiler-rt] Fix running tests on macOS when XCode is not installed.
Jul 26 2019, 1:35 AM · Restricted Project, Restricted Project
arichardson created D65322: [asan_symbolize] Avoid blocking when llvm-symbolizer is installed as addr2line.
Jul 26 2019, 1:30 AM · Restricted Project, Restricted Project

Jul 25 2019

arichardson updated the summary of D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 25 2019, 1:01 AM · Restricted Project, Restricted Project

Jul 24 2019

arichardson added inline comments to D60389: FileCheck [9/12]: Add support for matching formats.
Jul 24 2019, 2:14 PM · Restricted Project
arichardson committed rGa8104b49272d: [LLD] Do not print additional newlines after reaching error limit (authored by arichardson).
[LLD] Do not print additional newlines after reaching error limit
Jul 24 2019, 1:57 PM
arichardson committed rL366944: [LLD] Do not print additional newlines after reaching error limit.
[LLD] Do not print additional newlines after reaching error limit
Jul 24 2019, 1:56 PM
arichardson closed D65198: [LLD] Do not print additional newlines after reaching error limit.
Jul 24 2019, 1:56 PM · Restricted Project
arichardson added a comment to D55596: Reimplement Thread Static Data ASan routines with TLS.
In D55596#1599656, @dim wrote:
In D55596#1599456, @dim wrote:

This broke ASAN on FreeBSD (same for the MSAN change). When loading static thread_local struct tsd_key key this is done using __tls_get_addr. The interceptor for __tls_get_addr then calls GetCurrentThread which calls AsanTSDGet which again calls __tls_get_addr.
If I remove the || SANITIZER_FREEBSD it works fine (at least on FreeBSD 11.2).

Yes indeed, this is https://bugs.llvm.org/show_bug.cgi?id=40761. I'm unsure what a good solution direction is.

I just spent some time debugging and it seems like https://reviews.llvm.org/D55596 works.

Ehm, that is exactly *this* review? Maybe you meant to paste another? :) (Btw, you can just post the abbreviation D55596 and Phabricator will pick it up, like so: D55596.)

Yes I actually mean D65221

Jul 24 2019, 1:22 PM · Restricted Project, Restricted Project
arichardson added reviewers for D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD: dim, bsdjhb.
Jul 24 2019, 1:21 PM · Restricted Project, Restricted Project
arichardson updated the diff for D65198: [LLD] Do not print additional newlines after reaching error limit.

add test

Jul 24 2019, 10:24 AM · Restricted Project
arichardson added a comment to D55596: Reimplement Thread Static Data ASan routines with TLS.
In D55596#1599456, @dim wrote:

This broke ASAN on FreeBSD (same for the MSAN change). When loading static thread_local struct tsd_key key this is done using __tls_get_addr. The interceptor for __tls_get_addr then calls GetCurrentThread which calls AsanTSDGet which again calls __tls_get_addr.
If I remove the || SANITIZER_FREEBSD it works fine (at least on FreeBSD 11.2).

Yes indeed, this is https://bugs.llvm.org/show_bug.cgi?id=40761. I'm unsure what a good solution direction is.

Jul 24 2019, 9:53 AM · Restricted Project, Restricted Project
arichardson created D65221: [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSD.
Jul 24 2019, 9:48 AM · Restricted Project, Restricted Project
arichardson added inline comments to D65198: [LLD] Do not print additional newlines after reaching error limit.
Jul 24 2019, 9:07 AM · Restricted Project
Herald added a project to D55596: Reimplement Thread Static Data ASan routines with TLS: Restricted Project.

This broke ASAN on FreeBSD (same for the MSAN change). When loading static thread_local struct tsd_key key this is done using __tls_get_addr. The interceptor for __tls_get_addr then calls GetCurrentThread which calls AsanTSDGet which again calls __tls_get_addr.
If I remove the || SANITIZER_FREEBSD it works fine (at least on FreeBSD 11.2).

Jul 24 2019, 7:58 AM · Restricted Project, Restricted Project
arichardson created D65198: [LLD] Do not print additional newlines after reaching error limit.
Jul 24 2019, 4:05 AM · Restricted Project

Jul 12 2019

arichardson added a comment to D60387: FileCheck [7/12]: Arbitrary long numeric expressions.

Thanks for your work on this! Looking forward to be able to use these new features the next time I update our fork.

Jul 12 2019, 8:25 AM · Restricted Project

Jul 9 2019

arichardson added a comment to D64121: Rename variables so that they start with a lowercase letter..

This will cause big merge conflicts the next time I update our CHERI fork. However, the change itself looks good to me so I have no objections.

Jul 9 2019, 2:52 AM · Restricted Project

Jul 5 2019

arichardson accepted D64226: [FileCheck] Factor some parsing checks out.
Jul 5 2019, 1:37 AM · Restricted Project

Jul 3 2019

arichardson added inline comments to D64130: [LLD][ELF] - Linkerscript: add a support for expressions for section's filling.
Jul 3 2019, 9:11 AM · Restricted Project

Jun 30 2019

arichardson added inline comments to rL363059: [ELF] Make the rule to create relative relocations in a writable section….
Jun 30 2019, 1:49 PM

Jun 20 2019

arichardson added inline comments to D60389: FileCheck [9/12]: Add support for matching formats.
Jun 20 2019, 3:13 AM · Restricted Project
arichardson added inline comments to D60388: FileCheck [8/12]: Define numeric var from expr.
Jun 20 2019, 2:59 AM · Restricted Project

Jun 12 2019

arichardson added a comment to D31924: SROA: Allow eliminating addrspacecasted allocas.

I think this looks like it will improve codegen for us and not violate any of our C-level guarantees. Hopefully @arichardson can also take a look.

Jun 12 2019, 1:45 AM

Jun 11 2019

arichardson added inline comments to D60387: FileCheck [7/12]: Arbitrary long numeric expressions.
Jun 11 2019, 4:24 AM · Restricted Project
arichardson added a comment to D63125: FileCheck: Return parse error w/ Error & Expected.

Looks good to me. Just two minor comments:

Jun 11 2019, 4:10 AM · Restricted Project
arichardson added a comment to D63121: [ELF] Make the rule to create relative relocations in a writable section stricter.

This looks good to me. However, I think the name SymbolicRel does not make it immediately obvious to me it should be used for. Maybe add a comment to the member?

Jun 11 2019, 1:15 AM · Restricted Project

May 22 2019

arichardson added a comment to D42748: [ELF] Don't create a .dynamic section when linking with -Bstatic.
In D42748#1511604, @kib wrote:

From the description

This also causes a .dynamic section, the _DYNAMIC symtbol and a PT_DYNAMIC header to be added to the output file. This causes problems for example when trying to run such a binary on FreeBSD MIPS.

What I know is just that the presence of _DYNAMIC caused a problem but I don't have more information why it caused the problem. Without more information I can only conjecture. My intuition says it is more likely a problem if the dynamic is absent in some scenarios, I don't understand how the presence (though probably unexpected by you) caused a problem.

The C Runtime (cumulative of crt1.o and libc.so/libc.a) contains a lot of code like if (&_DYNAMIC != NULL) used as a test for the static/dynamic situation. Look at the https://github.com/freebsd/freebsd/blob/master/lib/csu/amd64/crt1.c#L62, there are many more. I believe it was mentioned many times in the discussion.

Perhaps first you should define what features of static binaries you depend on. In fact PT_INTERP is not absolutely needed to have any of the dynamic feature, in principle rtld.c can be linked from crt1.o. And if we (FreeBSD) decide to support dlopen(3) from static binaries, this is what would happen. We already got a small dynamic linker in crt1.o to support ifunc relocations.

Absence of the DYNAMIC segment is rather good indication that a lot of dynamic features are indeed not used, so &_DYNAMIC == 0 is probably quite good check except that it is broken.

@kib So to answer your question, I need more information.

And if we (FreeBSD) decide to support dlopen(3) from static binaries

And if you decide to support static pie, you also need _DYNAMIC.

Are you sure about this ? For static PIE, as I understand, we miss some kind of relocator in csu. For the relocator to work, all we need is to find the relocation section' boundaries. See for instance https://github.com/freebsd/freebsd/blob/master/lib/csu/common/ignore_init.c#L52 how we find iplt relocations in static binaries. I would expect that a similar approach works for non-iplt.

May 22 2019, 2:52 AM · Restricted Project
arichardson added a comment to D42748: [ELF] Don't create a .dynamic section when linking with -Bstatic.

@arichardson
If the MIPS problem was similar to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236165 ,
moving away from &_DYNAMIC will be a more reliable approach.
To check if an executable is dynamically linked, inspecting PT_INTERP is a better choice.

Checking if a weak undefined symbol has zero address is unreliale.
Some compilers may produce a GOT-generating relocation, some may produce an absolute relocation.
After linking, you may see the relocation resolved to static 0, or see a dynamic relocation (if at runtime there is some module providing the dynamic symbol, the weak reference will resolve to non-zero)

Quoting http://www.sco.com/developers/gabi/latest/ch4.symtab.html

The behavior of weak symbols in areas not specified by this document is implementation defined. Weak symbols are intended primarily for use in system software. Applications using weak symbols are unreliable since changes in the runtime environment might cause the execution to fail.

May 22 2019, 2:36 AM · Restricted Project

May 9 2019

arichardson added a comment to D61710: lld: Add a warning limit, similar to the existing error limit.

I implemented the same thing for the CHERI fork of lld since I added some new warning that could in certain cases be emitted many times but are not necessarily a real problem.

What would you do if something is not a real problem? I'd think "fix all warning" is generally a good idea, so I'd try to fix the problem (if it is not a real problem) or suppress the warning, and when suppressing a warning, I'd do one by one. So I wouldn't personally suppress warnings as a whole, as it could hide other warnings.

May 9 2019, 1:35 AM · Restricted Project
arichardson added a comment to D61710: lld: Add a warning limit, similar to the existing error limit.

I implemented the same thing for the CHERI fork of lld since I added some new warning that could in certain cases be emitted many times but are not necessarily a real problem.

May 9 2019, 12:46 AM · Restricted Project

May 8 2019

arichardson added a reviewer for D49942: [ASAN] Port asan to FreeBSD/mips64.: Restricted Project.
May 8 2019, 10:48 AM · Restricted Project, Restricted Project

May 2 2019

arichardson added inline comments to D60385: FileCheck [5/12]: Introduce regular numeric variables.
May 2 2019, 2:39 AM · Restricted Project

Apr 24 2019

arichardson added a comment to D59725: Additions to creduce script.

I've stumbled into an issue with the script:
It got a line: clang: /build/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2582: bool {anonymous}::IndVarSimplify::run(llvm::Loop*): Assertion L->isRecursivelyLCSSAForm(*DT, *LI) && "LCSSA required to run indvars!"' failed.`
And produced the following grep: grep 'L->isRecursivelyLCSSAForm(*DT, *LI) && "LCSSA required to run indvars!"' t.log || exit 1
But that doesn't work, escapes should be applied. it should be
grep 'L->isRecursivelyLCSSAForm(\*DT, \*LI) && \"LCSSA required to run indvars!\"' t.log || exit 1

Apr 24 2019, 11:46 AM · Restricted Project, Restricted Project

Apr 16 2019

arichardson added inline comments to D60383: FileCheck [3/12]: Stricter parsing of @LINE expressions.
Apr 16 2019, 7:27 AM · Restricted Project
arichardson accepted D60773: [llvm-objcopy] Support full list of bfd targets that lld uses..

Thanks for fixing this! LGTM

Apr 16 2019, 7:23 AM · Restricted Project

Apr 11 2019

arichardson added a comment to D60555: [llvm-objcopy] Fill .symtab_shndx section correctly.

Test case?

Have you seen bug description?
The problem with test case is that it requires file with large number of sections of which at least some should have relocation sections.
I have 19Mb object file generated by clang, but I'm not sure if using it as test case is a good idea ...

Sorry, I skipped over that somehow (I think I jumped straight from the bug). We already have at least one test that uses many sections (see many-sections.test). That unzips a pre-built object to achieve this. One option might be to update that object file (and possibly the test), if it can satisfy the prerequisites you need.

Apr 11 2019, 3:05 AM · Restricted Project

Mar 29 2019

arichardson accepted D59725: Additions to creduce script.

LGTM once the tempfile is deleted.

Mar 29 2019, 2:51 AM · Restricted Project, Restricted Project

Mar 28 2019

arichardson added a comment to D59725: Additions to creduce script.

Only a few more nits on my side, and this LGTM. WDYT, arichardson?

Mar 28 2019, 3:13 AM · Restricted Project, Restricted Project

Mar 26 2019

arichardson added inline comments to D59725: Additions to creduce script.
Mar 26 2019, 2:26 AM · Restricted Project, Restricted Project

Mar 21 2019

arichardson added a comment to D57940: Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries.

dispatch using Config->IsRela

The value of getAddend<ELFT>(Rel); now only seems to be in Ref.getRawDataRefImpl().p now. Shouldn't the rel case also be adding the implicit addend? I'm not sure I'm reading the code currently but it looks to me like REL no longer gets the addend added.

Mar 21 2019, 5:25 PM · Restricted Project