All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup
@ 2015-04-08  5:49 Guenter Roeck
  2015-04-08  6:14 ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2015-04-08  5:49 UTC (permalink / raw)
  To: Chris Zankel
  Cc: Max Filippov, linux-xtensa, linux-kernel, Guenter Roeck,
	Ard Biesheuvel, Arnd Bergmann

Commit 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup
input section") introduced a new .text.fixup section which is merged
with .text at link time. This causes xtensa builds to fail with lots
of error messages similar to the following.

lib/lib.a(kobject.o): In function `kobject_create':
(.text+0x498): dangerous relocation: l32r: literal placed after use:
				     (.literal+0x150)

Linker script transformation needs to be updated to detect and handle
the new section.

Fixes: 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup
		     input section")
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 arch/xtensa/kernel/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile
index 18d962a..d3a0f0f 100644
--- a/arch/xtensa/kernel/Makefile
+++ b/arch/xtensa/kernel/Makefile
@@ -29,6 +29,7 @@ AFLAGS_head.o += -mtext-section-literals
 
 sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \
 	-e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g'	 \
+	-e 's/\*(\(\.text .*\))/*(.literal \1)/g'			 \
 	-e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g'
 
 quiet_cmd__cpp_lds_S = LDS     $@
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup
  2015-04-08  5:49 [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup Guenter Roeck
@ 2015-04-08  6:14 ` Max Filippov
  2015-04-08 13:08   ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Max Filippov @ 2015-04-08  6:14 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Chris Zankel, linux-xtensa, LKML, Ard Biesheuvel, Arnd Bergmann

Hi Guenter,

On Wed, Apr 8, 2015 at 8:49 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> Commit 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup
> input section") introduced a new .text.fixup section which is merged
> with .text at link time. This causes xtensa builds to fail with lots
> of error messages similar to the following.
>
> lib/lib.a(kobject.o): In function `kobject_create':
> (.text+0x498): dangerous relocation: l32r: literal placed after use:
>                                      (.literal+0x150)
>
> Linker script transformation needs to be updated to detect and handle
> the new section.

I've posted a patch for it to the linux-xtensa ML a while ago:
http://lists.linux-xtensa.org/pipermail/linux-xtensa/Week-of-Mon-20150330/001913.html

> Fixes: 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup
>                      input section")
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  arch/xtensa/kernel/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile
> index 18d962a..d3a0f0f 100644
> --- a/arch/xtensa/kernel/Makefile
> +++ b/arch/xtensa/kernel/Makefile
> @@ -29,6 +29,7 @@ AFLAGS_head.o += -mtext-section-literals
>
>  sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \
>         -e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g'       \
> +       -e 's/\*(\(\.text .*\))/*(.literal \1)/g'                        \

This doesn't handle literals for .text.fixup AFAICT.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup
  2015-04-08  6:14 ` Max Filippov
@ 2015-04-08 13:08   ` Guenter Roeck
  2015-04-08 23:27     ` Chris Zankel
       [not found]     ` <CAP6Y9+9GwG2DU4Yw2xOOTg8DqpgD8aDMBK8Uaiu5a4HOa7fX9Q@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Guenter Roeck @ 2015-04-08 13:08 UTC (permalink / raw)
  To: Max Filippov
  Cc: Chris Zankel, linux-xtensa, LKML, Ard Biesheuvel, Arnd Bergmann

On 04/07/2015 11:14 PM, Max Filippov wrote:
> Hi Guenter,
>
> On Wed, Apr 8, 2015 at 8:49 AM, Guenter Roeck <linux@roeck-us.net> wrote:
>> Commit 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup
>> input section") introduced a new .text.fixup section which is merged
>> with .text at link time. This causes xtensa builds to fail with lots
>> of error messages similar to the following.
>>
>> lib/lib.a(kobject.o): In function `kobject_create':
>> (.text+0x498): dangerous relocation: l32r: literal placed after use:
>>                                       (.literal+0x150)
>>
>> Linker script transformation needs to be updated to detect and handle
>> the new section.
>
> I've posted a patch for it to the linux-xtensa ML a while ago:
> http://lists.linux-xtensa.org/pipermail/linux-xtensa/Week-of-Mon-20150330/001913.html
>
>> Fixes: 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup
>>                       input section")
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>>   arch/xtensa/kernel/Makefile | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile
>> index 18d962a..d3a0f0f 100644
>> --- a/arch/xtensa/kernel/Makefile
>> +++ b/arch/xtensa/kernel/Makefile
>> @@ -29,6 +29,7 @@ AFLAGS_head.o += -mtext-section-literals
>>
>>   sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \
>>          -e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g'       \
>> +       -e 's/\*(\(\.text .*\))/*(.literal \1)/g'                        \
>
> This doesn't handle literals for .text.fixup AFAICT.
>
It doesn't, but then it wasn't supposed to. .text.fixup is arm specific.

Guenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup
  2015-04-08 13:08   ` Guenter Roeck
@ 2015-04-08 23:27     ` Chris Zankel
       [not found]     ` <CAP6Y9+9GwG2DU4Yw2xOOTg8DqpgD8aDMBK8Uaiu5a4HOa7fX9Q@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Zankel @ 2015-04-08 23:27 UTC (permalink / raw)
  To: Max Filippov
  Cc: Guenter Roeck, linux-xtensa, LKML, Ard Biesheuvel, Arnd Bergmann

On Wed, Apr 8, 2015 at 6:08 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> On 04/07/2015 11:14 PM, Max Filippov wrote:
>>> Linker script transformation needs to be updated to detect and handle
>>> the new section.
>> I've posted a patch for it to the linux-xtensa ML a while ago:
>> http://lists.linux-xtensa.org/pipermail/linux-xtensa/Week-of-Mon-20150330/001913.html
>> This doesn't handle literals for .text.fixup AFAICT.
>>
> It doesn't, but then it wasn't supposed to. .text.fixup is arm specific.
>
> Guenter

Hi Max,

It would seem Guenter's fix addresses the issue. Are there any additional
benefits in your patch (better localized code, etc.?)

Cheers!
-Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup
       [not found]     ` <CAP6Y9+9GwG2DU4Yw2xOOTg8DqpgD8aDMBK8Uaiu5a4HOa7fX9Q@mail.gmail.com>
@ 2015-04-09  4:57       ` Max Filippov
  0 siblings, 0 replies; 5+ messages in thread
From: Max Filippov @ 2015-04-09  4:57 UTC (permalink / raw)
  To: Chris Zankel
  Cc: Guenter Roeck, linux-xtensa, LKML, Ard Biesheuvel, Arnd Bergmann

On Thu, Apr 9, 2015 at 2:24 AM, Chris Zankel <chris@zankel.net> wrote:
> It would seem Guenter's fix addresses the issue. Are there any additional
> benefits in your patch (better localized code, etc.?)

It's a bit more generic. Maybe it's not an advantage.

Also we have a rule for .text already, in the first line.
Instead of adding new line, closing parenthesis could
be removed there:

> diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile
> index 18d962a..d3a0f0f 100644
> --- a/arch/xtensa/kernel/Makefile
> +++ b/arch/xtensa/kernel/Makefile
> @@ -29,6 +29,7 @@ AFLAGS_head.o += -mtext-section-literals
>   sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \
>          -e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g'       \
> +       -e 's/\*(\(\.text .*\))/*(.literal \1)/g'                       \

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-09  4:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08  5:49 [PATCH -next] xtensa: Fix fix linker script transformation for .text / .text.fixup Guenter Roeck
2015-04-08  6:14 ` Max Filippov
2015-04-08 13:08   ` Guenter Roeck
2015-04-08 23:27     ` Chris Zankel
     [not found]     ` <CAP6Y9+9GwG2DU4Yw2xOOTg8DqpgD8aDMBK8Uaiu5a4HOa7fX9Q@mail.gmail.com>
2015-04-09  4:57       ` Max Filippov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.