Page MenuHomePhabricator

psmith (Peter Smith)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 17 2015, 9:03 AM (392 w, 23 h)

Recent Activity

Mon, Mar 13

psmith committed rG7ef47dd54e2d: [LLD] Increase thunk pass limit (authored by psmith).
[LLD] Increase thunk pass limit
Mon, Mar 13, 3:06 AM · Restricted Project
psmith closed D145786: [LLD] Increase thunk pass limit.
Mon, Mar 13, 3:06 AM · Restricted Project, Restricted Project

Jan 24 2022

psmith committed rGa08447d0de5d: [LLD][ELF][AArch64] Update test with incorrect REQUIRES line [NFC] (authored by psmith).
[LLD][ELF][AArch64] Update test with incorrect REQUIRES line [NFC]
Jan 24 2022, 2:07 AM
psmith closed D117896: [LLD][ELF][AArch64] Update test with incorrect REQUIRES line [NFC].
Jan 24 2022, 2:07 AM · Restricted Project

Sep 8 2021

psmith committed rGb026ce9c8a81: [MC] Add Subtarget for MAsmParser call to emitCodeAlignment (authored by psmith).
[MC] Add Subtarget for MAsmParser call to emitCodeAlignment
Sep 8 2021, 5:29 AM
psmith closed D109425: [MC] Add Subtarget for MAsmParser call to emitCodeAlignment.
Sep 8 2021, 5:29 AM · Restricted Project

Sep 7 2021

psmith committed rGe63455d5e0e5: [MC] Use local MCSubtargetInfo in writeNops (authored by psmith).
[MC] Use local MCSubtargetInfo in writeNops
Sep 7 2021, 7:47 AM
psmith committed rG5e71839f7793: [MC] Add MCSubtargetInfo to MCAlignFragment (authored by psmith).
[MC] Add MCSubtargetInfo to MCAlignFragment
Sep 7 2021, 7:47 AM
psmith closed D45962: [MC] Use local MCSubtargetInfo in writeNops.
Sep 7 2021, 7:47 AM · Restricted Project
psmith closed D45961: [MC] Add MCSubtargetInfo to MCAlignFragment.
Sep 7 2021, 7:47 AM · Restricted Project, Restricted Project

Jun 30 2021

psmith committed rGfc1cb3104b6b: [LLD][ELF][ARM] Tidy up test to hook up missing filecheck patterns [NFC] (authored by psmith).
[LLD][ELF][ARM] Tidy up test to hook up missing filecheck patterns [NFC]
Jun 30 2021, 6:17 AM
psmith closed D104907: [LLD][ELF][ARM] Tidy up test to hook up missing filecheck patterns [NFC].
Jun 30 2021, 6:17 AM · Restricted Project
psmith committed rGdd4d3f74062c: [LLD][ELF][ARM] Fix case of patched unrelocated BLX (authored by psmith).
[LLD][ELF][ARM] Fix case of patched unrelocated BLX
Jun 30 2021, 6:08 AM
psmith closed D104905: [LLD][ELF][ARM] Fix case of patched unrelocated BLX.
Jun 30 2021, 6:08 AM · Restricted Project

Mar 2 2021

psmith committed rGe35929e02664: [LLD][ELF][ARM] Refactor inBranchRange to use addend for PC Bias (authored by psmith).
[LLD][ELF][ARM] Refactor inBranchRange to use addend for PC Bias
Mar 2 2021, 3:06 AM
psmith closed D97550: [LLD][ELF][ARM] Refactor inBranchRange to use addend for PC Bias.
Mar 2 2021, 3:06 AM · Restricted Project

Jan 30 2021

psmith added a comment to D95198: [ELF] Fix program header alloc when first PT_LOAD is not at lowest VMA.

Apologies for the delay in responding. Is there any reason why the ELF Header and Program Header need to be covered by a PT_LOAD region at all? For example if the ELF file is on flash somewhere. The RTOS loader reads the ELF header and program header from the file in flash. If the program headers are not in the address range covered by any PT_LOAD then there is no need to copy the program headers into the TCM or SDRAM. As I understand it with -nmagic (and no PHDRS) neither LLD or ld.bfd will attempt to put the ELF Header and Program Header into a PT_LOAD segment.

Jan 30 2021, 8:22 AM · Restricted Project
psmith added a comment to D95199: [ELF] Improve compatibility with ld.bfd linker scripts.

Apologies for the delay in responding. As I understand it, this would only cause a problem with PHDRS? Our implicit creation of program headers should already be in OutputSection order.

Jan 30 2021, 7:11 AM · Restricted Project
psmith added a comment to D95586: [ARM] permit PC as destination of MOVS.

Not much to add over what Renato has said. I've put some context into the special meaning of MOVS with the PC as destination. I'm not entirely sure why the MOVS with immediate is unrestricted, my guess is that it is a historical quirk of the encoding and has likely never been used.

Jan 30 2021, 4:47 AM · Restricted Project
psmith accepted D95730: [MC] Support SHF_GNU_RETAIN as section flag 'R'.

Code changes and test LGTM. The OSABI question is interesting, I don't have a particular good answer or suggestion, the whole area is a bit of a mess. Looking at what ELF says:

EI_OSABI
Byte e_ident[EI_OSABI] identifies the OS- or ABI-specific ELF extensions used by this file. Some fields in other ELF structures have flags and values that have operating system and/or ABI specific meanings; the interpretation of those fields is determined by the value of this byte. If the object file does not use any extensions, it is recommended that this byte be set to 0. If the value for this byte is 64 through 255, its meaning depends on the value of the e_machine header member. The ABI processor supplement for an architecture can define its own associated set of values for this byte in this range. If the processor supplement does not specify a set of values, one of the following values shall be used, where 0 can also be taken to mean unspecified.

The flag is in the OS specific range so it could clash with other OS specific flags, to be strictly compliant it should set an OSABI to avoid clashes. It is unfortunate that we can only set one value though. For example the Arm processor supplement defines a couple of OSABI flags. What is the combination of using a GNU OS specific flag? I think ELF is implying that OSABI should be set to GNU if there is no processor specific OSABI value, I guess a strictly compliant toolchain would not permit SHF_RETAIN if there is some other OSABI in action that doesn't also recognise SHF_RETAIN. Quite how practical that is, and how strictly it has been followed in the past is another matter though.

Jan 30 2021, 3:47 AM · Restricted Project

Jan 27 2021

psmith added a comment to D95198: [ELF] Fix program header alloc when first PT_LOAD is not at lowest VMA.

Thanks for the update and the link to D95199 . Thanks also for pointing out that this is reliant on the PHDR command, that wasn't clear from the description (I can see it in the test now). I'll try and take a deeper look at the weekend. Apologies I can only do this in my spare time and it is a busy week at the moment.

Jan 27 2021, 10:51 AM · Restricted Project

Jan 21 2021

psmith added a comment to D94612: [LLD][ELF][AArch64] Add support for R_AARCH64_LD64_GOTPAGE_LO15 relocation.

Looks like we need to make sure that the relocation is a static link time constant so that it can be used in PIE and Shared Libs. Otherwise LGTM.

Jan 21 2021, 10:00 AM · Restricted Project

Jan 19 2021

psmith added a comment to D94611: MC: AArch64: Add support for gotpage_lo15.

This looks ok to me. The gotpage_lo15 matches the operator name in GNU assembler.

Jan 19 2021, 10:05 AM · Restricted Project

Jan 15 2021

psmith added a comment to D94557: [ARM] Fixed incorrect lowering when using GNUEABI (libgcc) and 16bit floats.

As I understand it, this is about what library call should be made when there is an eabi target such as arm-none-eabi which should target the Run Time ABI for the Arm Architecture https://github.com/ARM-software/abi-aa/blob/master/rtabi32/rtabi32.rst and other Arm targets such as Linux or Android. I think if we're arguing from the specification then clang is compliant with the eabi, so relocatable objects produced by clang should be compatible with eabi compliant toolchains that supply the eabi functions, this includes non GNU toolchains as well like IAR.

Jan 15 2021, 3:35 AM · Restricted Project

Jan 14 2021

psmith added inline comments to D94612: [LLD][ELF][AArch64] Add support for R_AARCH64_LD64_GOTPAGE_LO15 relocation.
Jan 14 2021, 9:31 AM · Restricted Project
psmith added a comment to D94612: [LLD][ELF][AArch64] Add support for R_AARCH64_LD64_GOTPAGE_LO15 relocation.

Thanks for working on this. It will be very useful for people using GCC yet using LLD as a linker on AArch64. Will try and take a look later today, if not then I should have some time tomorrow morning.

Jan 14 2021, 8:10 AM · Restricted Project

Jan 8 2021

psmith accepted D94280: [ELF] --exclude-libs: localize defined libcall symbols referenced by lto.tmp.

LGTM, may be worth waiting for any other comments.

Jan 8 2021, 10:33 AM · Restricted Project

Jan 6 2021

psmith added inline comments to D93948: [MC] Merge section flags for user defined sections.
Jan 6 2021, 2:30 AM · Restricted Project

Dec 17 2020

psmith added a comment to D93467: [ELF] Rename R_TLS to R_TPREL and R_NEG_TLS to R_TPREL_NEG. NFC.

No objections from me, looks like a sensible change.

Dec 17 2020, 10:29 AM · Restricted Project

Dec 16 2020

psmith added a comment to D93241: [AArch64InstPrinter] Change printADRPLabel to print the target address in hexadecimal form.

The calculation looks good to me. It is logically equivalent to that given in the reference manual

Dec 16 2020, 2:03 AM · Restricted Project

Dec 15 2020

psmith added inline comments to D93241: [AArch64InstPrinter] Change printADRPLabel to print the target address in hexadecimal form.
Dec 15 2020, 2:55 AM · Restricted Project

Dec 10 2020

psmith added a comment to D93045: [ELF] AArch64: Handle DT_AARCH64_VARIANT_PCS.

Thanks for working on this. It looks like it implements the ABI correctly (see PR for links to the specification and GCC/Glibc details).

Dec 10 2020, 9:52 AM · Restricted Project

Nov 24 2020

psmith accepted D91995: [ELF] Rename adjustRelaxExpr to adjustTlsExpr and delete the unused `data` parameter.

Looks good to me. Thanks for tidying this up.

Nov 24 2020, 2:35 AM · Restricted Project
psmith added a comment to D91760: [Driver] Default Generic_GCC aarch64 to use -fasynchronous-unwind-tables.

Radio silence so far; I think no news is good news applies in this case. I'm happy to say no objections.

Nov 24 2020, 2:34 AM · Restricted Project

Nov 19 2020

psmith added a comment to D91760: [Driver] Default Generic_GCC aarch64 to use -fasynchronous-unwind-tables.

Personally I'm in favour of clang and gcc behaving the same way unless there is a good reason not to. I've shared the review internally to see if anyone has any concerns. May be worth informing the clang built linux community to see if they will need to make any alterations as a result.

Nov 19 2020, 6:40 AM · Restricted Project

Nov 17 2020

psmith added a comment to D91579: [ELF] --gc-sections: collect unused .gcc_except_table in section groups and associated text sections.

No objections from me. Although unrelated to the patch, isLSDA might be better called fromFDE, or couldBeLSDA? Maybe one for a later follow up.

Nov 17 2020, 3:13 AM · Restricted Project
psmith accepted D91510: [ELF] Fix interaction between --unresolved-symbols= and --[no-]allow-shlib-undefined.

LGTM, with one suggestion of a name change. I've checked the GNU ld behaviour against the green test changes and LLD matches.

Nov 17 2020, 2:57 AM · Restricted Project

Nov 12 2020

psmith added a comment to D90698: [builtins] Add support for single-precision-only-FPU ARM targets..

Assuming there are no problems with the bots or other downstream builds, please update the PR with a link to this review.

Nov 12 2020, 7:16 AM · Restricted Project
psmith added a comment to D90698: [builtins] Add support for single-precision-only-FPU ARM targets..

Now committed. Commit message has your name and email address.

Nov 12 2020, 7:13 AM · Restricted Project
psmith committed rG0c0eeb78eb0d: [builtins] Add support for single-precision-only-FPU ARM targets. (authored by chaosdefinition).
[builtins] Add support for single-precision-only-FPU ARM targets.
Nov 12 2020, 7:12 AM
psmith closed D90698: [builtins] Add support for single-precision-only-FPU ARM targets..
Nov 12 2020, 7:12 AM · Restricted Project
psmith accepted D91187: [ELF] Make SORT_INIT_PRIORITY support .ctors.N.

Thanks for updating the comments. If the lexical ordering is going to work out the same I don't have any objections.

Nov 12 2020, 3:59 AM · Restricted Project
psmith added a comment to D91127: [ELF] Sort by input order within an input section description.

Thanks for the updates, LGTM too.

Nov 12 2020, 3:54 AM · Restricted Project
psmith added a comment to D90698: [builtins] Add support for single-precision-only-FPU ARM targets..

If there are no more comments, can someone please commit this for me? I don't have commit access to LLVM.

Nov 12 2020, 1:27 AM · Restricted Project

Nov 11 2020

psmith added inline comments to D91127: [ELF] Sort by input order within an input section description.
Nov 11 2020, 3:17 AM · Restricted Project
psmith added a comment to D91187: [ELF] Make SORT_INIT_PRIORITY support .ctors.N.

Will take another look tonight.For reference, I tried helping out someone last year with https://bugs.llvm.org/show_bug.cgi?id=44698 I think they had old objects, or a an old GCC on their system and it was mixing with a modern clang. Maybe worth a read through.

Nov 11 2020, 3:09 AM · Restricted Project

Nov 10 2020

psmith added a comment to D91127: [ELF] Sort by input order within an input section description.

It took a lot of staring at that bit of code to work out what was going on. If I have understood it correctly. In particular I got confused with the sizeBefore and sizeLastSort with sizeBefore being the larger value. It took me a while to spot the continue. If I've understood correctly:

  • sizeBefore is really sizeOfRetBeforeNextSort
  • sizeLastSort is really sizeOfRetAfterPreviousSort

If possible could we use Prev rather than Last as it is more specific. Last can mean the last one we went by, or the last one in the list. I strongly recommend adding something like Next to sizeBefore so that it is clear that sizeBefore >= sizeLastSort.

Nov 10 2020, 3:54 PM · Restricted Project
psmith added a comment to D91180: [ELF] Support multiple SORT in an input section description.

Looks OK to me. Will be best to see if George has any comments about how to do the parsing.

Nov 10 2020, 2:25 PM · Restricted Project
psmith added a comment to D91187: [ELF] Make SORT_INIT_PRIORITY support .ctors.N.

Apologies for being so quiet recently. It looks like this is changing .ctors/.dtors away from SORT_BY_NAME when they aren't mixed with .init_array.

Nov 10 2020, 2:12 PM · Restricted Project

Nov 4 2020

psmith accepted D90698: [builtins] Add support for single-precision-only-FPU ARM targets..

This looks good to me. The __ARM_FP feature test macro is defined in the ACLE and 0x8 is the right flag to check for Double precision support. I've tested at least one single precision only build.

Nov 4 2020, 3:24 AM · Restricted Project

Oct 28 2020

psmith added a comment to D90108: [MC] Error for .globl/.local which change the symbol binding and warn for .weak.

We can surely loose it if it turns out to be a wide spreading problem.

The hard part is that regressions tend to get reported AFTER the release when it's too late to fix them. Maybe a warning for one release, then upgrade to hard error next release gives users more time to find and fix errors, and doesn't result in an unusable release version for anyone?

I don't have any specific evidence to suggest that we'd run into a problem doing this, but my personal thinking is that adding an option to allow disabling this error might be a good idea. I wouldn't be surprised to find code bases where fixing the code is non-trivial. Ideally, the option would not be made widely known unless actually asked for and/or heavily labelled with things saying something like "this is a temporary option that will be deleted in a future change unless a compelling reason is found not to".

If there are concerns, I can make .globl foo; .weak foo a warning instead of error. The others are still errors.

Oct 28 2020, 1:35 PM · Restricted Project
psmith added a comment to D86142: [LLD] Search archives for non-tentative defintions..

I've left a few small suggestions but overall no objections. Given that this is the default BFD behaviour and programs that have only been linked with LLD are not likely to use common; I think that if this behaviour is to be put under an option, it is on by default. This will permit users to use both GNU ld and lld with the same command line.

Oct 28 2020, 1:22 PM · Restricted Project, Restricted Project, Restricted Project

Oct 27 2020

psmith added a comment to D90108: [MC] Error for .globl/.local which change the symbol binding and warn for .weak.

If we issue a warning instead, users will only notice the semantic difference when they use -Wa,--fatal-warnings. We can classify the potential risks on whether .local is used:

  • .local is used: .local is a very rare directive.
  • .local is not used: the issue is about .weak and .globl . This represents a semantic difference between MC and GNU ld. There may be a few more but I doubt there can be more than a few. Can we try error first and switch to a warning if it turns out to be a problem?
Oct 27 2020, 1:50 AM · Restricted Project

Oct 26 2020

psmith added a comment to D90108: [MC] Error for .globl/.local which change the symbol binding and warn for .weak.

Personally I'd err on the side of consistency with binutils. If they are happy to go to an error then we can. If they aren't then I recommend that we warn rather than error as we risk breaking builds for working software and it isn't always easy to get source code fixed. Not got a strong opinion though so happy to go with the consensus.

Oct 26 2020, 11:49 AM · Restricted Project

Oct 22 2020

psmith added a comment to D89828: [ELF] Set SHF_INFO_LINK for .rel[a].plt and .rel[a].dyn.

LGTM too. Apologies for the delay. This looks like it is consistent with the ELF specification.

Oct 22 2020, 9:16 AM · Restricted Project

Oct 21 2020

psmith accepted D89841: [ELF] --gc-sections: retain dependent sections of non-SHF_ALLOC sections.

LGTM. If we are marking a section live it makes sense to mark its dependent sections live.

Oct 21 2020, 3:26 AM · Restricted Project

Oct 14 2020

psmith added a comment to D88877: [ELF] Drop --whole-archive before processing dependent libraries..

I don't have any objections. My comment in the thread was more along the lines that dependent libraries could interact with whole-archive in hard to predict ways. I'm happy to have dependent libraries ignore whole-archive. I'm fine with MaskRay accepting when he is happy.

Oct 14 2020, 9:04 AM · Restricted Project, lld

Sep 29 2020

psmith accepted D88478: [llvm-readobj][ARM] - Improve support of printing unwind (-u) information for non-relocatable objects..

Looks good to me. Thanks very much for adding the functionality.

Sep 29 2020, 10:38 AM · Restricted Project

Sep 28 2020

psmith accepted D88407: [llvm-readobj/elf] - Fix the PREL31 relocation computation used for dumping arm32 unwind info (-u)..

LGTM. Agree that it should be bit31 that is sign extended. Apologies for not catching this last time.

Sep 28 2020, 5:47 AM · Restricted Project

Sep 25 2020

psmith added a comment to D88228: [yaml2obj][obj2yaml] - Add support for SHT_ARM_EXIDX section..

What's here looks good to me to.

Sep 25 2020, 10:14 AM · Restricted Project

Sep 24 2020

psmith added a comment to D88228: [yaml2obj][obj2yaml] - Add support for SHT_ARM_EXIDX section..

I'll try and take a look tomorrow.

Sep 24 2020, 12:03 PM · Restricted Project

Sep 23 2020

psmith accepted D88076: [llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects..

Thanks for the update. LGTM. Happy to see other parts done in follow up commits

Sep 23 2020, 10:29 AM · Restricted Project

Sep 22 2020

psmith added a comment to D88076: [llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects..

I think there may still be problems in a non-relocatable ELF file when there is more than one executable output section as there is only one .ARM.exidx output section and only one sh_link.

Sep 22 2020, 11:45 AM · Restricted Project

Sep 21 2020

psmith accepted D88037: [ELF][test] Delete large temporary files and make some temporary files smaller with two text segments.

Looks good to me. Thanks for cleaning this up, it will be of great help to 32-bit bots.

Sep 21 2020, 11:27 AM · Restricted Project

Sep 17 2020

psmith added a comment to D87824: [lld][ELF][test] Add additional LTO testing.

LGTM too, thanks for adding the tests.

Sep 17 2020, 7:43 AM · Restricted Project

Sep 9 2020

psmith added a comment to D86762: [ELF] Add documentation for --warn-backrefs: a GNU ld compatibility checking tool (and lesser of layering detection).

Thanks for the update I'm happy with the edits.

Sep 9 2020, 12:47 PM · Restricted Project
psmith added a comment to D87121: LLD symbol ordering file binary name tag.

Will have to have a think. My initial reaction to "apply this file only when these conditions hold" is akin to moving part of the build system into the linker. It could be done, but I'm not sure it should be. For example if there were a linker script it would have to precisely match the inputs to make sense.

Sep 9 2020, 1:50 AM

Sep 4 2020

psmith added a comment to D86762: [ELF] Add documentation for --warn-backrefs: a GNU ld compatibility checking tool (and lesser of layering detection).

I've put some comments, mostly concentrating on the early part. I've not had a chance to go through the examples at the bottom in detail. I can't spot anything obviously wrong though.

Sep 4 2020, 3:14 AM · Restricted Project

Sep 2 2020

psmith added a comment to D69411: [MC] Resolve the difference of symbols in consecutive MCDataFragements.

I don't have any objections to the approval. Thanks for updating the comment.

Sep 2 2020, 12:40 PM · Restricted Project

Sep 1 2020

psmith added a comment to D69411: [MC] Resolve the difference of symbols in consecutive MCDataFragements.

Thanks for the update and sorry to take so long to comment. I can't see anything immediately wrong and I think limiting this to fragments in the same subsection makes sense.

Sep 1 2020, 2:47 PM · Restricted Project
psmith added a comment to D86762: [ELF] Add documentation for --warn-backrefs: a GNU ld compatibility checking tool (and lesser of layering detection).

I had a look in Levine's Linkers and Loaders book to see if I could find any source for back-references, all I could find was in 6.4 "Not all linkers do this; many just make a single sequential pass over the directory and miss any backwards depedencies from a file to another file earlier in the library. Tools like tsort and lorder can minimize the difficulty of using single-pass linkers but it's not uncommon for programmers to explicitly list the same library several times on the linker command line to force multiple passes and thus finally resolve all symbols."

Sep 1 2020, 1:01 AM · Restricted Project

Aug 26 2020

psmith added a comment to D86579: Add lld/ELF release notes for release/11.x.

Thanks for putting this together, looks good. I've added a few suggestions, and some typo spots.

Aug 26 2020, 10:51 AM · Restricted Project

Aug 25 2020

psmith added a comment to D86422: [ELF] .note.gnu.property: error for invalid pr_datasize.

LGTM too, I'm happy my comments were addressed, thanks.

Aug 25 2020, 3:35 AM · Restricted Project

Aug 24 2020

psmith added a comment to D86422: [ELF] .note.gnu.property: error for invalid pr_datasize.

Overall looking good. I think there may be an endianness problem with reinterpret_cast although I could easily be wrong without testing (I don't think we have a target that uses .note.gnu.property with big-endian support in LLD).

Aug 24 2020, 1:06 AM · Restricted Project

Aug 20 2020

psmith added a comment to D86263: [ELF] Keep st_type for symbol assignment.

Had a chance to look over lunch. Thanks looks good to me too.

Aug 20 2020, 5:02 AM · Restricted Project
psmith added a comment to D86263: [ELF] Keep st_type for symbol assignment.

Not had a chance to look into the changes in detail yet, but on first glance it looks good. Given that the compiler uses STT_FUNC for the entry of a symbol I think it is reasonable to retain the type only for an alias.

Aug 20 2020, 2:42 AM · Restricted Project

Aug 19 2020

psmith added a comment to D86142: [LLD] Search archives for non-tentative defintions..

In ELF the last paragraph of the section on STT_COMMON only mentions that a dynamic linker may change its resolution rules to prefer non-common over a common definition. I'm guessing extending this to static linker is something that some other linkers have done and there are some programs that currently depend on that behaviour.

Symbols with type STT_COMMON label uninitialized common blocks. In relocatable objects, these symbols are not allocated and must have the special section index SHN_COMMON (see below). In shared objects and executables these symbols must be allocated to some section in the defining object.
Aug 19 2020, 1:23 AM · Restricted Project, Restricted Project, Restricted Project

Aug 14 2020

psmith accepted D84001: [ELF] Allow mixed SHF_LINK_ORDER & non-SHF_LINK_ORDER sections and sort within InputSectionDescription.

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.

Aug 14 2020, 5:47 AM · Restricted Project
psmith accepted D85867: [ELF] Assign file offsets of non-SHF_ALLOC after SHF_ALLOC and set sh_addr=0 to non-SHF_ALLOC.

Thanks for the update. I'm happy with the changes. I've tentatively approved, James/Edd please shout if you have any objections?

Aug 14 2020, 5:38 AM · Restricted Project
psmith added a comment to D85056: [ELF] Add --keep-section to expose linkerscript KEEP directive as a linker flag.

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.

One observation I'd make about the proposed implementation is that it looks like it only implements a subset of the Linker Script KEEP command that supports precise matches of a section name. Quoting from the GNU linker manual:

When link-time garbage collection is in use (`--gc-sections'), it is often useful to mark sections that should not be eliminated. This is accomplished by surrounding an input section's wildcard entry with KEEP(), as in KEEP(*(.init)) or KEEP(SORT_BY_NAME(*)(.ctors)).

That permits the full power of the input section description to discriminate via object, as there can be many sections with the same name. Wildcards can sometimes be useful too.

I think it would be worth considering a richer interface for keep-sections. In Arm's proprietary linker we permitted a similar syntax as for the equivalent linker script. This did mean quoting or escaping parentheses but did provide equivalence in what could be achieved.

Having a non-INSERT-AFTER/BEFORE SECTIONS command is considered an external linker script and can change the default layout decisions. I can also feel sympathy with the users but I am also wary of adding these non-orthogonal features. The recent D76482 (__build_id_start = .) and this patch make me think of output section descriptions (a fragment of a SECTIONS command) which do not affect section layout.

@psmith @grimar I think we probably should start a conversation with binutils about such a feature. If they find needs as well, we will have a common ground, it'd be great. They need to be given the decision making opportunity to reduce the risk they create a similar but incompatible feature in the future.

One idea is:

OVERRIDE SECTIONS {
  .foo : { KEEP(*(.foo)) }
  .bar : { KEEP(*(.bar)) }
  sym = .;   // symbol assignments are disallowed
}

The output section descriptions will override .foo & .bar in the external linker script. If the external linker script does not describe .foo or .bar, the command will change the orphan sections.

Another syntax:

SECTIONS {
  .foo : { KEEP(*(.foo)) }
  .bar : { KEEP(*(.bar)) }
} REPLACE .foo;
Aug 14 2020, 5:28 AM · Restricted Project

Aug 13 2020

psmith added a comment to D85867: [ELF] Assign file offsets of non-SHF_ALLOC after SHF_ALLOC and set sh_addr=0 to non-SHF_ALLOC.

Just to check I understand.

Aug 13 2020, 12:49 AM · Restricted Project

Aug 12 2020

psmith added a comment to D85785: [ELF] -r: allow SHT_X86_64_UNWIND to be merged into SHT_PROGBITS.

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.

Aug 12 2020, 1:32 AM · Restricted Project

Aug 11 2020

psmith accepted D85651: [LLD][ELF] - Do not produce an invalid dynamic relocation order with --shuffle-sections..

Looks good to me. Will be worth seeing if MaskRay has any comments.

Aug 11 2020, 1:09 AM · Restricted Project

Aug 10 2020

psmith added a comment to D85618: [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate.

Thanks for the update, I'm happy when George is.

Aug 10 2020, 10:02 AM · Restricted Project
psmith accepted D85661: [ELF] Avoid creating a 2.1GB output file in arm-exidx-range.s.

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.

Aug 10 2020, 10:00 AM · Restricted Project
psmith added a comment to D85618: [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate.

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.

Aug 10 2020, 12:59 AM · Restricted Project

Aug 6 2020

psmith added a comment to D85239: [DOCS] Add more detail to stack protector documentation.

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.

Aug 6 2020, 11:27 AM · Restricted Project
psmith committed rG839d974ee0e4: [DOCS] Add more detail to stack protector documentation (authored by psmith).
[DOCS] Add more detail to stack protector documentation
Aug 6 2020, 5:59 AM
psmith closed D85239: [DOCS] Add more detail to stack protector documentation.
Aug 6 2020, 5:59 AM · Restricted Project

Aug 5 2020

psmith abandoned D75347: [MC][ELF][ARM] Add relocations for some ARM pc-relative fixups..

Yes. I think the consensus was to match the GCC behaviour, I'll abandon the revision.

Aug 5 2020, 8:20 AM · Restricted Project
psmith added a comment to D85100: [ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD.

FWIW this looks good to me too.

Aug 5 2020, 8:19 AM · Restricted Project, Restricted Project
psmith added a comment to D85086: [ELF] --oformat=binary: use LMA to compute file offsets.

No objections from me either. I guess LGTM if George's last comment can be resolved.

Aug 5 2020, 8:08 AM · Restricted Project
psmith added inline comments to D85239: [DOCS] Add more detail to stack protector documentation.
Aug 5 2020, 4:57 AM · Restricted Project
psmith updated the diff for D85239: [DOCS] Add more detail to stack protector documentation.

uploaded diff with both Options.td and ClangCommandLineReference.rst

Aug 5 2020, 4:57 AM · Restricted Project
psmith added a comment to D85239: [DOCS] Add more detail to stack protector documentation.

This file is auto generated. The real documentation should go to clang/include/clang/Driver/Options.td

Aug 5 2020, 4:56 AM · Restricted Project
psmith added a comment to D84610: [ELF] --icf: don't fold text sections with LSDA.

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.

Aug 5 2020, 1:17 AM · Restricted Project
psmith added a comment to D84825: [ELF] Change tombstone values to (.debug_ranges/.debug_loc) 1 and (other .debug_*) 0.

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.

Aug 5 2020, 1:12 AM · Restricted Project

Aug 4 2020

psmith requested review of D85239: [DOCS] Add more detail to stack protector documentation.
Aug 4 2020, 12:34 PM · Restricted Project
psmith added a comment to D85086: [ELF] --oformat=binary: use LMA to compute file offsets.

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."

Aug 4 2020, 1:09 AM · Restricted Project

Aug 1 2020

psmith added a comment to D85056: [ELF] Add --keep-section to expose linkerscript KEEP directive as a linker flag.

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.

Aug 1 2020, 5:30 AM · Restricted Project