From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbdFVHrw (ORCPT ); Thu, 22 Jun 2017 03:47:52 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:32951 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbdFVHrv (ORCPT ); Thu, 22 Jun 2017 03:47:51 -0400 Subject: Re: [RFC PATCH 04/10] objtool: add undwarf debuginfo generation To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra References: <848a1c6a1384ff5dd40ff204e1ace7e07559fde0.1496293620.git.jpoimboe@redhat.com> <20170614132732.52etdpbvtbv7os6m@treble> From: Jiri Slaby Message-ID: <43b8b50a-238b-aade-3fc7-ad2595de0f4e@suse.cz> Date: Thu, 22 Jun 2017 09:47:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170614132732.52etdpbvtbv7os6m@treble> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/14/2017, 03:27 PM, Josh Poimboeuf wrote: > I agree with all your comments, will fix them all. Thanks for the > review. This is not the correct way: ++ if (flags & O_WRONLY) ++ cmd = ELF_C_WRITE; ++ else if (flags & O_RDWR) ++ cmd = ELF_C_RDWR; ++ else ++ cmd = ELF_C_READ_MMAP; For this particular codeflow, it works, but it should be: (flags & O_ACCMODE) == O_WRONLY == O_RDWR thanks, -- js suse labs