[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <995ff767-9220-f9c8-c052-2b717cc7e91d@virtuozzo.com>
Date: Thu, 18 Aug 2016 13:08:39 +0300
From: Andrey Ryabinin <aryabinin@...tuozzo.com>
To: Dmitry Vyukov <dvyukov@...gle.com>
CC: Jeff Dike <jdike@...toit.com>, Richard Weinberger <richard@....at>,
user-mode-linux-devel <user-mode-linux-devel@...ts.sourceforge.net>,
LKML <linux-kernel@...r.kernel.org>,
Stefan Traby <stefan@...lo-penguin.com>,
stable <stable@...r.kernel.org>
Subject: Re: [PATCH] UML: don't discard .text.exit section
On 08/17/2016 08:11 PM, Dmitry Vyukov wrote:
> On Wed, Aug 17, 2016 at 8:10 AM, Andrey Ryabinin
> <aryabinin@...tuozzo.com> wrote:
>> Commit e41f501d3912 ("vmlinux.lds: account for destructor sections")
>> added '.text.exit' to EXIT_TEXT which is discarded at link time by default.
>> This breaks compilation of UML:
>> `.text.exit' referenced in section `.fini_array' of
>> /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o):
>> defined in discarded section `.text.exit' of
>> /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o)
>>
>> Apparently UML doesn't want to discard exit text, so let's place all EXIT_TEXT
>> sections in .exit.text.
>>
>> Fixes: e41f501d3912 ("vmlinux.lds: account for destructor sections")
>> Reported-by: Stefan Traby <stefan@...lo-penguin.com>
>> Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
>> Cc: <stable@...r.kernel.org> # 4.0+
>> ---
>> arch/um/include/asm/common.lds.S | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
>> index 1dd5bd8..1330553 100644
>> --- a/arch/um/include/asm/common.lds.S
>> +++ b/arch/um/include/asm/common.lds.S
>> @@ -81,7 +81,7 @@
>> .altinstr_replacement : { *(.altinstr_replacement) }
>> /* .exit.text is discard at runtime, not link time, to deal with references
>> from .altinstructions and .eh_frame */
>> - .exit.text : { *(.exit.text) }
>> + .exit.text : { EXIT_TEXT }
>> .exit.data : { *(.exit.data) }
>>
>> .preinit_array : {
>> --
>> 2.7.3
>>
>
>
> Sorry for delays, I am travelling.
> Do we need ".fini_array" section? It's also destructors that we don't
> run. Or does UML use them? Does discarding ".fini_array" help?
>
libc has desctructors and use them for whatever purpose it needs.
Powered by blists - more mailing lists