- User Since
- Sep 17 2015, 9:03 AM (256 w, 1 d)
Given that it is possible to write a linker script that does work with *(pattern1 pattern2) then I don't have any objections. I've tentatively approved as it looks like was the most cautious here.
Thanks for the update. I'm happy with the changes. I've tentatively approved, James/Edd please shout if you have any objections?
Just to check I understand.
Wed, Aug 12
I think this should be ok for .ARM.exidx sections as they have a SHF_LINK_ORDER dependency which prevents them from being merged in relocatable links.
Tue, Aug 11
Looks good to me. Will be worth seeing if MaskRay has any comments.
Mon, Aug 10
Thanks for the update, I'm happy when George is.
Thanks for spotting that. I'd personally prefer to fix in the linker script, rather than make the code RW but I don't have a strong preference.
Simplification looks good to me. I'm not sure about the test changes as I would have expected the change to be NFC. If these are test improvements it will be worth altering separately.
Thu, Aug 6
I agree it's not what I'd like. I'm not sure how to react to MaskRays comment. The top of the ClangCommandLineReference.rst says:
------------------------------------------------------------------- NOTE: This file is automatically generated by running clang-tblgen -gen-opt-docs. Do not edit this file by hand!! -------------------------------------------------------------------
This uses Options.td to generate the file. I don't know how true this is anymore given that both files are checked in. They may have been separated. I've seen at least one instance in the log where the whole file has been regenerated.
Wed, Aug 5
Yes. I think the consensus was to match the GCC behaviour, I'll abandon the revision.
FWIW this looks good to me too.
No objections from me either. I guess LGTM if George's last comment can be resolved.
uploaded diff with both Options.td and ClangCommandLineReference.rst
I agree I think it is best to err on the side of correctness. As I understand it we could do better (merge more sections) but this would involve pulling apart .eh_frame sections to show equivalence. I think that could come later.
My apologies for not commenting earlier. I haven't had a lot of spare time and I only have a weak opinion, certainly far weaker than the other commenters.
Tue, Aug 4
I agree with MaskRay that if we do support the feature then we should make sure it works or document its limitations, even if our limitations are "Implemented to the degree that it supports the FreeBSD Kernel, we recommend producing an ELF file and using llvm-objcopy --output-target=binary."
Sat, Aug 1
I do have some sympathy with wanting to use a command line option to keep an individual section from the command line as it has been useful in Arm's proprietary linker, although this is mainly due to the convenience of not having to create or modify another file.
Fri, Jul 31
It is a pity that the section name is not a valid C identifier otherwise start_ and stop_ would have been generated automatically.
Wed, Jul 29
Mon, Jul 20
This looks good to me. Regardless of whether we allow --gc-sections it will be worth getting this right for /DISCARD/. Will be worth waiting to see if there are any further comments from other reviewers.
I guess if the use case for -r is a kernel module then garbage collection can make sense as the "object" is not relinked. What happens when there is no GC root? I think it will be worth detecting that and turning GC off as otherwise everything will get removed which is unlikely to be what was wanted.
Sat, Jul 18
Fri, Jul 17
I'll take a look over the weekend, also at D72904, apologies won't be able to get to it today.
Jul 13 2020
What would happen if there was a single .text section containing multiple functions, would that produce multiple .gcc_except_table sections each with a SHF_LINK_ORDER dependency on the single .text section? I think that this is OK as there are no other sections that refer to .gcc_except_table and there doesn't need to be a total order. Ideally we could have one .gcc_except_table section per associated .text section.
Jul 8 2020
Jul 7 2020
I think an option makes sense. I have a small reservation about making users order their matches on the command line. We should make it more explicit in the help and the manual, or try and sort the matches using a heuristic order of specificity, for example no wildcards is more specific than wildcards, longer text is more specific than shorter. Other than that I think it looks OK.
LGTM it looks like a good simplification. Worth waiting a little bit to see if there are any objections.
Jul 6 2020
LGTM, it looks like it is difficult to generate local dynamic from clang, although it is possible with GCC. I was able to make a test application, that also had the advantage of working for shared libraries and PIE as R_ABS does not in that case.
Jul 3 2020
Thanks, will take a look over the weekend. Would like to make sure all is well running some TLS test cases on a native Arm machine, fully expect it to be OK.
I'm ok with this as is. I'll need to check over what should be happening on Arm, but I think that can be done in a separate change.
Jul 1 2020
This looks OK to me, happy for George to approve . I'm not a Windows filesystem expert by any means, it seems like the rename then delete follows the pattern in https://boostgsoc13.github.io/boost.afio/doc/html/afio/FAQ/deleting_open_files.html though.
Jun 24 2020
Looks good to me. Agree that symbol versioning should be passed through in a relocatable link.
Jun 23 2020
Thanks for the update, I don't have any more comments. Happy when MaskRay is happy.
Jun 19 2020
Jun 18 2020
I think that this is highly likely to be a typo, it looks like it dates to the contribution of compiler-rt so there isn't any history we can use. I believe that compiler-rt builtins originated in Apple so there is a possibility that SOFTFP was used in the compiler at contribution time. If you wanted to be safe you could support both SOFTFP and SOFT_FP but I don't think that is necessary. I would like to think that for a soft-fp target the tests for these functions fail or are at least xfailed at the moment. Are you able to compile the tests for a soft-fp target to check?
Jun 16 2020
I only partially followed the discussion on llvm-dev. The resolution sounds sensible to me. Will be good to get someone involved in the upstream discussion to check it over.
Jun 12 2020
Looking good so far. Would be good to add a range extension thunk test case. For example:
.section .text.1, "ax", %progbits .global _start .type _start, %function _start: .word callee@PLT - .
Jun 10 2020
That looks good to me too. Thanks for the updates.
Jun 9 2020
I've moved the codes below the block of relocations representing TLS.
Jun 8 2020
LGTM, I don't have a better idea.
Thanks for the comments. When I made the change I looked at:
Static relocation codes for ELF64 object files begin at (257); dynamic ones at (1024). Both (0) and (256) should be accepted as values of R_AARCH64_NONE, the null relocation. Static relocation codes for ELF32 object files begin at ; dynamic ones at .
I couldn't find anything about a TLS range, but it looks like there is one being observed even if it isn't explicitly called out. Let me know if you've spotted it?
Jun 5 2020
Thanks for the update. I don't have any more comments. Looks good to me.
Jun 4 2020
Jun 3 2020
Looks sensible to me. A couple of comment suggestions only.
Jun 2 2020
LGTM, looks like a good idea. We may find other places where this form will be useful.
LGTM from an Arm person now that the Android changes have been made.
Jun 1 2020
LGTM too, makes sense to keep as compatible with binutils as possible.
FWIW I'm happy for Clang to match GCC behaviour for Linux (non-Android) targets with respect to the frame pointer. Outside of Android I would expect most developers of linux applications to build with both GCC and clang so they should already have the -fno-omit-frame-pointer if they are using it.
May 27 2020
Thanks for the update. I'm happy with the changes.
Looks reasonable to me. Our documentation and help for dynamic-list is a bit sparse, it may be worth emphasising that it implies -bsymbolic (if I've understood correctly).
May 19 2020
May 18 2020
Just thinking if it would be possible to resolve this without having to read the verneed section of shared objects. I've not checked to see if this would make a simpler implementation though.
May 15 2020
No objections from me, this does seem to be more consistent with the Coding Standards.
May 13 2020
Thanks for the updates, I don't have any more comments. Happy if George is happy.
May 12 2020
Looks good to me. The intention is that the little and big-endian table flags match, only the Offset is expected to change for big-endian, and this change does make sure that the flags match. Will be worth waiting a day or so to see if there are any further comments.
I don't have a lot to add. I think this change will work with LLD and the GNU tools, no objections to this change. Having LLD not recognise the section names without a suffix may become a problem if GNU tools still output them. My guess is that LLD is still most used with clang at the moment, but this may change over time.
May 11 2020
Thanks for the review. I've applied the suggestion to remove the function.
May 10 2020
May 8 2020
LGTM too. Thanks for the update.
May 6 2020
I definitely think we should do this for all new options. I agree that -o magic ought to be changed as I can see that happening in practice. The chance that someone intending -t hinlto-index-only rather than -thinlto-index-only is much lower. I'll defer to the users of thin-lto whether they think this is important.
May 5 2020
May 4 2020
I don't have a strong opinion here, the spaced bytes more closely match the output of the llvm-mc which can make disassembler tests easier to write. On the other hand it can be useful to see the structure of the disassembly of instructions when the mapping symbols exist.
Arm GNU objdump does the following:
address: 12345678 <spaces> <disassembly of arm instruction address: 1234 5678 <spaces> for 32-bit Thumb instruction made up of two half words address: 1234 <spaces> for 16-bit Thumb instruction made up a half word address: 12345678 <spaces> for .word 0x12345678
I don't have a lot of experience of non Arm RISC architectures though so I don't know what looks reasonable for them.
Applied previous review comments. Added missing REQUIRES, added CHECK-NOT and simplified range checking code.
Thanks for the comments, will update diff shortly.
Thanks for the comments. I've updated the patch prior to commit.
May 2 2020
Add context to diff
Thanks for following this up. This looks good to me, will be worth waiting till Monday to see if there are comments throughout the working day.
Apr 27 2020
Thanks for the update, I'm happy with that. Will be worth seeing if MaskRay or George have any final comments.
Apr 25 2020
Thanks for the patch. I think what you have looks like it will work.
Apr 24 2020
Apr 23 2020
I had to revert due to an msan build bot failure. I don't fully understand it yet http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/40693/steps/check-lld%20msan/logs/stdio as I can't yet see how script->assignAddresses would not set OutSec->addr. However msan is more likely to be right than me.
Apr 22 2020
Added additional detail in comment and fix up spacing in tests.
Thanks, and apologies for forgetting George's comment request. I'll upload a new version and commit tomorrow.
I've updated the tests to address review comments, and have made the addresses increase in LMA. I've got a follow up patch that I can send for SHF_LINK_ORDER as I can reproduce a problem with a similar test case.
LGTM. Thanks for the updates and congratulations on getting the binutils patch accepted.