[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190816155136.po23te4zi3k263wm@linux.intel.com>
Date: Fri, 16 Aug 2019 18:51:36 +0300
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: "Xing, Cedric" <cedric.xing@...el.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
linux-sgx@...r.kernel.org, akpm@...ux-foundation.org,
dave.hansen@...el.com, sean.j.christopherson@...el.com,
nhorman@...hat.com, npmccallum@...hat.com, serge.ayoun@...el.com,
shay.katz-zamir@...el.com, haitao.huang@...el.com,
andriy.shevchenko@...ux.intel.com, tglx@...utronix.de,
kai.svahn@...el.com, bp@...en8.de, josh@...htriplett.org,
luto@...nel.org, kai.huang@...el.com, rientjes@...gle.com
Subject: Re: [PATCH v21 24/28] selftests/x86: Add a selftest for SGX
On Fri, Aug 16, 2019 at 06:43:44PM +0300, Jarkko Sakkinen wrote:
> On Wed, Jul 17, 2019 at 03:37:03PM -0700, Xing, Cedric wrote:
> > > +$(OUTPUT)/encl.bin: $(OUTPUT)/encl.elf $(OUTPUT)/sgxsign
> > > + objcopy --remove-section=.got.plt -O binary $< $@
> >
> > .got.plt section will never be present for statically linked binaries.
>
> You are right that it should not be there because the enclave does not
> use any library calls. And if it did, we would want to assert that and
> fail the compilation if it is the case.
>
> Assuming that .got.plt can never exist in a static binary, however, is
> simply not true. A common example are library calls such as strncpy().
> The default handler selects the fastest implementation and substitutes
> that to the GOT.
>
> The right way to fix this is to assert it in the linker script.
In addition, objcopy should be replaced with $(OBJCOPY).
/Jarkko
Powered by blists - more mailing lists