Page MenuHomePhabricator
Feed Advanced Search

Oct 24 2018

ivanlozano accepted D53645: Include input section name and output section name in an error message..
Oct 24 2018, 11:15 AM

Sep 5 2018

ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

Thanks echristo!

Sep 5 2018, 7:25 PM
ivanlozano added inline comments to D48792: [ARM] Set execute-only flags in .text..
Sep 5 2018, 3:41 PM
ivanlozano updated the diff for D48792: [ARM] Set execute-only flags in .text..

Added additional comments to clarify to the source code additions.

Sep 5 2018, 3:41 PM
ivanlozano updated the diff for D48792: [ARM] Set execute-only flags in .text..

Added a setTargetSectionFlags virtual method to MCELFObjectTargetWriter and moved the logic that modifies the TextSection flags over to the ARMELFObjectWriter.

Sep 5 2018, 2:39 PM
ivanlozano added inline comments to D48792: [ARM] Set execute-only flags in .text..
Sep 5 2018, 2:39 PM

Aug 30 2018

ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

Just to follow up on the earlier issue I mentioned where handwritten assembly sections named .text were not getting the execute-only flag applied ( D48792#1186500 ), it seems I was mistaken. Defining the section as below does result in the execute-only flags being set properly in the object file.

.section .text,"axy",%progbits,unique,0;
Aug 30 2018, 10:09 AM
ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

Thanks for the update. I still think this looks good to me.

I'm out of quick ideas for how to do this in a better way. The only other ways that I can think of are to not pre-create the .text section and create in on demand if needed; or find some way of deleting it afterwards. These may be possible but will be more disruptive. I think that this will handle the LTO case where the "link-step" clang invocation doesn't get passed the -fexecute-only flag, which IIRC was the main reason not to just create the TextSection with the execute-only flag in the first place based on the presence of -fexecute-only.

Aug 30 2018, 9:51 AM

Aug 29 2018

ivanlozano added inline comments to D48792: [ARM] Set execute-only flags in .text..
Aug 29 2018, 3:49 PM
ivanlozano updated the diff for D48792: [ARM] Set execute-only flags in .text..

Added a new check condition to test/CodeGen/ARM/execute-only.ll to make sure the bare ".text" section is not emitted in assembly output that should be execute-only.

Aug 29 2018, 3:48 PM
ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

I've added a couple of comments. One other thing to think about is the -S output from the compiler. If I compile a trivial test case with -mexecute-only I get the output:

	.text
	.syntax unified
	.eabi_attribute	67, "2.09"	@ Tag_conformance
...
	.section	.text,"axy",%progbits,unique,0
	.globl	func                    @ -- Begin function func
...

I'm not sure how easy it will be to change .text to .section .text, "axy", %progbits. In theory if this is assembled with MC and this patch it should come out with execute only (may be worth a test case). Re-assembling with GNU as will likely create a .text section without SHF_ARM_PURECODE but I don't think that this isn't likely enough in practice to worry too much about.

Aug 29 2018, 8:48 AM

Aug 28 2018

ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

Friendly ping for anyone familiar with the MC infrastructure to take a look at this. Thanks.

Aug 28 2018, 7:33 AM

Aug 22 2018

ivanlozano updated the diff for D48792: [ARM] Set execute-only flags in .text..

Added the additional HasData property and check to see if data has been emitted to the .text section.

Aug 22 2018, 12:34 PM

Aug 21 2018

ivanlozano added inline comments to D48792: [ARM] Set execute-only flags in .text..
Aug 21 2018, 3:48 PM

Aug 14 2018

ivanlozano added inline comments to D48792: [ARM] Set execute-only flags in .text..
Aug 14 2018, 10:20 AM
ivanlozano updated the diff for D48792: [ARM] Set execute-only flags in .text..
Aug 14 2018, 10:20 AM

Aug 6 2018

ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

I'll put together a separate patch (probably next week) for the .text assembly issue to keep this patch from growing more complicated, and to have the discussion in a dedicated thread. I've got an idea for how to handle it which basically boils down to passing execute-only to cc1as and making a couple changes to ARMAsmParser and MCTargetOptions, but there are some details that need to be hammered out still.

Aug 6 2018, 8:33 AM

Aug 2 2018

ivanlozano updated the diff for D48792: [ARM] Set execute-only flags in .text..

The updated patch adds support for the case peter.smith brought up by checking for an empty .text section that's paired with SHF_ARM_PURECODE sections.

Aug 2 2018, 5:17 PM

Jul 30 2018

ivanlozano abandoned D48795: [AArch64] Add support for SHF_ARM_PURECODE..

Alternative solution committed: rL338271

Jul 30 2018, 10:18 AM
ivanlozano abandoned D48794: [AArch64] Implement execute-only support..

Alternative solution committed: rL338271

Jul 30 2018, 10:18 AM
ivanlozano abandoned D48793: [AArch64] Set execute-only flags in .text..

Alternative solution committed: rL338271

Jul 30 2018, 10:18 AM
ivanlozano abandoned D48791: [AArch64] Implement execute-only CodeGen Support..

Alternative solution committed: rL338271

Jul 30 2018, 10:17 AM
ivanlozano added a comment to D49456: [AArch64] Support execute-only LOAD segments..

If this looks good, could someone with commit access please land it? Thank you!

Jul 30 2018, 8:56 AM

Jul 27 2018

ivanlozano updated the diff for D49456: [AArch64] Support execute-only LOAD segments..

Added the test to make sure that linker scripts are handled correctly. Also added a check against Script->HasSectionsCommand in checkOptions differentiate between Config->SingleRoRx being set via the command-line arg and being set via the script parser.

Jul 27 2018, 3:02 PM
ivanlozano updated the diff for D49456: [AArch64] Support execute-only LOAD segments..

Added a check in finalizeSections() for intermingled data and executable sections. Also moved the computeFlags() check for ExecuteOnly to occur before the SingleRoRx check.

Jul 27 2018, 11:27 AM

Jul 26 2018

ivanlozano added inline comments to D49456: [AArch64] Support execute-only LOAD segments..
Jul 26 2018, 4:20 PM
ivanlozano added inline comments to D49456: [AArch64] Support execute-only LOAD segments..
Jul 26 2018, 3:07 PM
ivanlozano updated the diff for D49456: [AArch64] Support execute-only LOAD segments..

As mentioned in my last comment, I'm disabling the execute-only flag when linker scripts with sections defined are used. This also changes the proposed flag from "aarch64-execute-only" to just "execute-only" and makes the suggested modifications to the test.

Jul 26 2018, 1:40 PM

Jul 18 2018

ivanlozano added a comment to D49456: [AArch64] Support execute-only LOAD segments..

Is this for compatibility with an existing option, or is this a new option? If this is new, I think -aarch64 prefix might be undesirable -- even though "execute only" pages are currently supported by AArch64 among major ISAs, I can imagine that other ISA could support it. So a more platform-neutral naming might be better.

Jul 18 2018, 2:35 PM

Jul 17 2018

ivanlozano added a comment to D49456: [AArch64] Support execute-only LOAD segments..

This is an alternative to the patch set D48791, D48793, D48794, D48795 for supporting execute-only segments in AArch64 targets, as per the discussion in D48791.

Jul 17 2018, 4:26 PM
ivanlozano created D49456: [AArch64] Support execute-only LOAD segments..
Jul 17 2018, 4:25 PM

Jul 10 2018

ivanlozano added a comment to D48791: [AArch64] Implement execute-only CodeGen Support..

This seems reasonable to me. I'll look into putting together an LLD patch that does this. Thanks!

Jul 10 2018, 10:24 AM

Jul 3 2018

ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

Yea this is what I'm seeing as well with the patched version unfortunately. I'll poke around the code and see if there's anywhere appropriate where we might be able to change the initial TextSection at a later stage.

Jul 3 2018, 2:33 PM
ivanlozano added a comment to D48792: [ARM] Set execute-only flags in .text..

Yea I wasn't sure exactly which approach to take here. Initially I thought that setting the TextSection to always include SHF_ARM_PURECODE was the way to go since I hadn't seen that section being used when generating object files from source. However I discovered from running the test suite that this section is used when assembling machine code and outputting an object-file with llvm-mc. This erroneously set the SHF_ARM_PURECODE flag when no execute-only flag was provided. This leads me to believe there may be other scenarios where this section is used as well.

Jul 3 2018, 8:55 AM

Jun 29 2018

ivanlozano added a comment to D48791: [AArch64] Implement execute-only CodeGen Support..

Passed an IR file to llc with a mix of functions that have the execute-only attribute set and ones that don't to test this. Two .text sections are generated in the object file, one with the SHF_ARM_PURECODE flag set and one without, and functions reside in their respective sections.

Jun 29 2018, 5:03 PM
ivanlozano added a comment to D48791: [AArch64] Implement execute-only CodeGen Support..

What happens if the input IR has a mix of execute-only and non-execute-only functions? Does the output .text section have the SHF_ARM_PURECODE flag?

Jun 29 2018, 4:29 PM
ivanlozano added inline comments to D48791: [AArch64] Implement execute-only CodeGen Support..
Jun 29 2018, 3:16 PM
ivanlozano added a parent revision for D48795: [AArch64] Add support for SHF_ARM_PURECODE.: D48791: [AArch64] Implement execute-only CodeGen Support..
Jun 29 2018, 3:12 PM
ivanlozano added a child revision for D48791: [AArch64] Implement execute-only CodeGen Support.: D48795: [AArch64] Add support for SHF_ARM_PURECODE..
Jun 29 2018, 3:12 PM
ivanlozano updated the summary of D48795: [AArch64] Add support for SHF_ARM_PURECODE..
Jun 29 2018, 3:11 PM
ivanlozano created D48795: [AArch64] Add support for SHF_ARM_PURECODE..
Jun 29 2018, 3:11 PM
ivanlozano added a child revision for D48791: [AArch64] Implement execute-only CodeGen Support.: D48794: [AArch64] Implement execute-only support..
Jun 29 2018, 3:09 PM
ivanlozano added a parent revision for D48794: [AArch64] Implement execute-only support.: D48791: [AArch64] Implement execute-only CodeGen Support..
Jun 29 2018, 3:09 PM
ivanlozano created D48794: [AArch64] Implement execute-only support..
Jun 29 2018, 3:07 PM
ivanlozano added a child revision for D48791: [AArch64] Implement execute-only CodeGen Support.: D48793: [AArch64] Set execute-only flags in .text..
Jun 29 2018, 3:02 PM
ivanlozano added a parent revision for D48793: [AArch64] Set execute-only flags in .text.: D48791: [AArch64] Implement execute-only CodeGen Support..
Jun 29 2018, 3:02 PM
ivanlozano created D48793: [AArch64] Set execute-only flags in .text..
Jun 29 2018, 3:02 PM
ivanlozano created D48792: [ARM] Set execute-only flags in .text..
Jun 29 2018, 2:59 PM
ivanlozano added a reviewer for D48791: [AArch64] Implement execute-only CodeGen Support.: eugenis.
Jun 29 2018, 2:50 PM
ivanlozano created D48791: [AArch64] Implement execute-only CodeGen Support..
Jun 29 2018, 2:43 PM