All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
@ 2015-04-08 21:05 Chen Gang
  2015-04-08 21:10 ` Richard Weinberger
  0 siblings, 1 reply; 21+ messages in thread
From: Chen Gang @ 2015-04-08 21:05 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel

l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
is too big, it may be overwritten, the related issue:

    LD      init/built-in.o
  init/built-in.o: In function `do_early_param':
  init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/built-in.o: In function `unknown_bootoption':

blackfin is for embedded system, the size limitition is acceptable, so
it is not the real world issue, which should be skipped if COMPILE_TEST
enabled.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 arch/blackfin/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 2ece4e3..e5195b4 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -20,6 +20,9 @@ endif
 KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
 KBUILD_CFLAGS_MODULE    += -mlong-calls
 LDFLAGS                 += -m elf32bfin
+ifeq ($(CONFIG_COMPILE_TEST),y)
+LDFLAGS                 += --noinhibit-exec
+endif
 
 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
 
-- 
1.9.3

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:05 [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled Chen Gang
@ 2015-04-08 21:10 ` Richard Weinberger
  2015-04-08 21:16   ` Chen Gang
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Weinberger @ 2015-04-08 21:10 UTC (permalink / raw)
  To: Chen Gang, realmz6; +Cc: adi-buildroot-devel, linux-kernel

Am 08.04.2015 um 23:05 schrieb Chen Gang:
> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
> is too big, it may be overwritten, the related issue:
> 
>     LD      init/built-in.o
>   init/built-in.o: In function `do_early_param':
>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>   init/built-in.o: In function `unknown_bootoption':
> 
> blackfin is for embedded system, the size limitition is acceptable, so
> it is not the real world issue, which should be skipped if COMPILE_TEST
> enabled.

You're again papering over the real issue.
COMPILE_TEST is only one way to generate a too big kernel.
The right thing is to blow up and warn the user.

Thanks,
//richard

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:10 ` Richard Weinberger
@ 2015-04-08 21:16   ` Chen Gang
  2015-04-08 21:19     ` Richard Weinberger
  0 siblings, 1 reply; 21+ messages in thread
From: Chen Gang @ 2015-04-08 21:16 UTC (permalink / raw)
  To: Richard Weinberger, realmz6; +Cc: adi-buildroot-devel, linux-kernel

On 4/9/15 05:10, Richard Weinberger wrote:
> Am 08.04.2015 um 23:05 schrieb Chen Gang:
>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>> is too big, it may be overwritten, the related issue:
>>
>>     LD      init/built-in.o
>>   init/built-in.o: In function `do_early_param':
>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/built-in.o: In function `unknown_bootoption':
>>
>> blackfin is for embedded system, the size limitition is acceptable, so
>> it is not the real world issue, which should be skipped if COMPILE_TEST
>> enabled.
> 
> You're again papering over the real issue.
> COMPILE_TEST is only one way to generate a too big kernel.
> The right thing is to blow up and warn the user.
> 

If COMPILE_TEST is not set, the right thing is to blow up and warn the
user.

But for me, if COMPILE_TEST is set, the right thing is to warn the user
without blowing up (the user already know about it -- he/she only care
about the building test).


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:16   ` Chen Gang
@ 2015-04-08 21:19     ` Richard Weinberger
  2015-04-09 13:15       ` Chen Gang
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Weinberger @ 2015-04-08 21:19 UTC (permalink / raw)
  To: Chen Gang, realmz6; +Cc: adi-buildroot-devel, linux-kernel

Am 08.04.2015 um 23:16 schrieb Chen Gang:
> On 4/9/15 05:10, Richard Weinberger wrote:
>> Am 08.04.2015 um 23:05 schrieb Chen Gang:
>>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>>> is too big, it may be overwritten, the related issue:
>>>
>>>     LD      init/built-in.o
>>>   init/built-in.o: In function `do_early_param':
>>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>   init/built-in.o: In function `unknown_bootoption':
>>>
>>> blackfin is for embedded system, the size limitition is acceptable, so
>>> it is not the real world issue, which should be skipped if COMPILE_TEST
>>> enabled.
>>
>> You're again papering over the real issue.
>> COMPILE_TEST is only one way to generate a too big kernel.
>> The right thing is to blow up and warn the user.
>>
> 
> If COMPILE_TEST is not set, the right thing is to blow up and warn the
> user.
> 
> But for me, if COMPILE_TEST is set, the right thing is to warn the user
> without blowing up (the user already know about it -- he/she only care
> about the building test).

How can you be sure that the issue you found is a) worth ignoring b) not solvable?
As you paper of it by adding an #ifdef COMPILE_TEST which is very hacky IMHO.

Thanks,
//richard

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:19     ` Richard Weinberger
@ 2015-04-09 13:15       ` Chen Gang
  0 siblings, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-04-09 13:15 UTC (permalink / raw)
  To: Richard Weinberger, realmz6; +Cc: adi-buildroot-devel, linux-kernel

On 4/9/15 05:19, Richard Weinberger wrote:
> Am 08.04.2015 um 23:16 schrieb Chen Gang:
>> On 4/9/15 05:10, Richard Weinberger wrote:
>>> Am 08.04.2015 um 23:05 schrieb Chen Gang:
>>>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>>>> is too big, it may be overwritten, the related issue:
>>>>
>>>>     LD      init/built-in.o
>>>>   init/built-in.o: In function `do_early_param':
>>>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>>   init/built-in.o: In function `unknown_bootoption':
>>>>
>>>> blackfin is for embedded system, the size limitition is acceptable, so
>>>> it is not the real world issue, which should be skipped if COMPILE_TEST
>>>> enabled.
>>>
>>> You're again papering over the real issue.
>>> COMPILE_TEST is only one way to generate a too big kernel.
>>> The right thing is to blow up and warn the user.
>>>
>>
>> If COMPILE_TEST is not set, the right thing is to blow up and warn the
>> user.
>>
>> But for me, if COMPILE_TEST is set, the right thing is to warn the user
>> without blowing up (the user already know about it -- he/she only care
>> about the building test).
> 
> How can you be sure that the issue you found is a) worth ignoring b) not solvable?

Firstly, it is not the real world issue, and if the kernel is too big,
it has to cause reloc overflow.  For me, we can treat it as hardware
limitation, the user should not let the kernel too big.

And kernel support COMPILE_TEST which means the user is mainly focus on
building. For me, blackfin also needs to support COMPILE_TEST.


> As you paper of it by adding an #ifdef COMPILE_TEST which is very hacky IMHO.
> 

For me, it is not a good idea to make a conclusion during discussing.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
       [not found] ` <5525994D.6090901@hotmail.com>
  2015-07-01 15:31   ` Chen Gang
@ 2015-07-01 15:36   ` Chen Gang
  1 sibling, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-07-01 15:36 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel

On 4/9/15 05:10, Chen Gang wrote:
> 
> After this patch, blackfin can pass allmodconfig building (if we treat
> it as allmodconfig). And next, I shall try to:
> 
>  - Send all related patches v2 for blackfin kernel within this month.
> 
>  - Fix blackfin gcc/binutils related issues within this month.
> 

After fix the 2 gcc bfin issues, the bfin can pass the allmodconfig for
next-20140401. And sorry for so late to fix the bfin related gcc issues.

 - Bug 65803 is fixed by me and integrated into gcc master branch, the
   related link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65803

 - Bug 66620 is fixed by gcc related members, my fix is incorrect (my
   fix can get the correct result, and also can let bfin kernel pass all
   modconfig, but it still left the insns in the inconsistent state).


Next I shall start allmodconfig for another architecture cris, hope I
can finish within this month.

Thanks.
> Thanks.
> 
> 
> On 4/9/15 05:03, Chen Gang wrote:
>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>> is too big, it may be overwritten, the related issue:
>>
>>     LD      init/built-in.o
>>   init/built-in.o: In function `do_early_param':
>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/built-in.o: In function `unknown_bootoption':
>>
>> blackfin is for embedded system, the size limitition is acceptable, so
>> it is not the real world issue, which should be skipped if COMPILE_TEST
>> enabled.
>>
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>>  arch/blackfin/Makefile | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
>> index 2ece4e3..e5195b4 100644
>> --- a/arch/blackfin/Makefile
>> +++ b/arch/blackfin/Makefile
>> @@ -20,6 +20,9 @@ endif
>>  KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
>>  KBUILD_CFLAGS_MODULE    += -mlong-calls
>>  LDFLAGS                 += -m elf32bfin
>> +ifeq ($(CONFIG_COMPILE_TEST),y)
>> +LDFLAGS                 += --noinhibit-exec
>> +endif
>>  
>>  KBUILD_DEFCONFIG := BF537-STAMP_defconfig
>>  
>>
> 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
       [not found] ` <5525994D.6090901@hotmail.com>
@ 2015-07-01 15:31   ` Chen Gang
  2015-07-01 15:36   ` Chen Gang
  1 sibling, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-07-01 15:31 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel

On 4/9/15 05:10, Chen Gang wrote:
> 
> After this patch, blackfin can pass allmodconfig building (if we treat
> it as allmodconfig). And next, I shall try to:
> 
>  - Send all related patches v2 for blackfin kernel within this month.
> 
>  - Fix blackfin gcc/binutils related issues within this month.
>

After fix the 2 gcc bfin issues, the bfin can pass the allmodconfig for
next-20140401. And sorry for so late to fix the bfin related gcc issues.

 - Bug 65803 is fixed by me and integrated into gcc master branch, the
   related link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65803

 - Bug 66620 is fixed by gcc related members, my fix is incorrect (my
   fix can get the correct result, and also can let bfin kernel pass all
   modconfig, but it still left the insns in the inconsistent state).


Next I shall start allmodconfig for another architecture cris, hope I
can finish within this month.

Thanks.
 
> Thanks.
> 
> 
> On 4/9/15 05:03, Chen Gang wrote:
>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>> is too big, it may be overwritten, the related issue:
>>
>>     LD      init/built-in.o
>>   init/built-in.o: In function `do_early_param':
>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/built-in.o: In function `unknown_bootoption':
>>
>> blackfin is for embedded system, the size limitition is acceptable, so
>> it is not the real world issue, which should be skipped if COMPILE_TEST
>> enabled.
>>
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>>  arch/blackfin/Makefile | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
>> index 2ece4e3..e5195b4 100644
>> --- a/arch/blackfin/Makefile
>> +++ b/arch/blackfin/Makefile
>> @@ -20,6 +20,9 @@ endif
>>  KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
>>  KBUILD_CFLAGS_MODULE    += -mlong-calls
>>  LDFLAGS                 += -m elf32bfin
>> +ifeq ($(CONFIG_COMPILE_TEST),y)
>> +LDFLAGS                 += --noinhibit-exec
>> +endif
>>  
>>  KBUILD_DEFCONFIG := BF537-STAMP_defconfig
>>  
>>
> 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-24  8:20         ` Steven Miao
@ 2015-04-24 14:28           ` Chen Gang
  0 siblings, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-04-24 14:28 UTC (permalink / raw)
  To: Steven Miao; +Cc: Richard Weinberger, bfin, linux-kernel

On 4/24/15 16:20, Steven Miao wrote:
> On Thu, Apr 23, 2015 at 10:30 PM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>>
>> OK, thanks. I guess your meaning is:
>>
>>  - If the kernel is too big, it may let the pc which wants to call L1
>>    space fail.
>>
>>  - So the kernel is too big to cause this issue, but it is nothing with
>>    'overwritten' in my original patch comments.
>>
> Yes, it is.

OK, thanks.

>>  - We can treat it as environments limitation, then can use COMPILE_TEST
>>    for it. So this patch is still OK, except the related comments need
>>    be improved (at least need to remove 'overwritten').
>>
> If pc-relative CALL will fail, there will be "relocation truncated to
> fit: R_BFIN_PCREL24" warnings.

OK, thanks. for me, we need to skip these warnings when COMPILE_TEST
is set, so can continue compiling (or will cause building break).

>>
>> I guess, what I said above is meaningless (although it is correct).
>>
>>>>  - if kernel is too big, the contents before l1.text (the other contents
>>>>    in .init.text) will override it, so ld reports issues.
>>
> Actually the kernel which is large the 16M could not happen, large
> size kernel image is not sugguested on a embedded system.
> 

OK, thanks. So for me, it should only happen when COMPILE_TEST is set,
should not happen in real world using.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-23 14:30       ` Chen Gang
@ 2015-04-24  8:20         ` Steven Miao
  2015-04-24 14:28           ` Chen Gang
  0 siblings, 1 reply; 21+ messages in thread
From: Steven Miao @ 2015-04-24  8:20 UTC (permalink / raw)
  To: Chen Gang; +Cc: Richard Weinberger, bfin, linux-kernel

On Thu, Apr 23, 2015 at 10:30 PM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
> On 4/23/15 10:51, Steven Miao wrote:
>> On Wed, Apr 22, 2015 at 10:32 PM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>>> On 4/22/15 17:00, Steven Miao wrote:
>>>> Hi,
>>>>
>>>> On Thu, Apr 9, 2015 at 5:03 AM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>>>>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>>>>> is too big, it may be overwritten, the related issue:
>>>>>
>>>>>     LD      init/built-in.o
>>>>>   init/built-in.o: In function `do_early_param':
>>>>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>> blackfin toolchain generate 24 bit pc-relative calls by default, with
>>>> a range of –16,777,216 through 16,777,214 (0xFF00 0000 to 0x00FF FFFE)
>>>> is available.
>>>> So call to l1_text should be ok. What do you mean the kernel is too big?
>>>> http://docs.blackfin.uclinux.org/doku.php?id=ism:call
>>>>
>>>>
>>>
>>> Excuse me, I am not quite familiar with what you said above, can we
>>> also treat 24-bit as 16MB size limitation for kernel size? I am not
>>> quite sure, could you provide more information about it?.
>>>
>>> And I checked "arch/blackfin/kernel/vmlinux.lds.S", for me, in current
>>> case:
>> The memory address on blackfin usually starts from 0, if pc = 0, the
>> pc relative call range is [0xFF00 0000 - 0xFFFFFFFF, 0 -  0x00FF
>> FFFE], it covers L1 space.
>> If the kernel is big than 16M, eg. pc = 0x100 0000, the pc relative
>> call range accordingly is [0x1 - 0x100 0000, 0x100 0000 - 0x 1FF FFFE
>> ], it cann't call to L1 space.
>
> OK, thanks. I guess your meaning is:
>
>  - If the kernel is too big, it may let the pc which wants to call L1
>    space fail.
>
>  - So the kernel is too big to cause this issue, but it is nothing with
>    'overwritten' in my original patch comments.
>
Yes, it is.
>  - We can treat it as environments limitation, then can use COMPILE_TEST
>    for it. So this patch is still OK, except the related comments need
>    be improved (at least need to remove 'overwritten').
>
If pc-relative CALL will fail, there will be "relocation truncated to
fit: R_BFIN_PCREL24" warnings.
>>>
>>>  - init section is the last section of kernel, l1.text is within init
>>>    section, and it is in the fixed address. The other contents before
>>>    l1.text are dynamic (depend on kernel size).
>>>
>
> I guess, what I said above is meaningless (although it is correct).
>
>>>  - if kernel is too big, the contents before l1.text (the other contents
>>>    in .init.text) will override it, so ld reports issues.
>
Actually the kernel which is large the 16M could not happen, large
size kernel image is not sugguested on a embedded system.

> I guess, what I said above is incorrect.
>
>
> Are all of I guesses correct?
>
>
> Thanks.
> --
> Chen Gang
>
> Open, share, and attitude like air, water, and life which God blessed

-steven

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-23  2:51     ` Steven Miao
@ 2015-04-23 14:30       ` Chen Gang
  2015-04-24  8:20         ` Steven Miao
  0 siblings, 1 reply; 21+ messages in thread
From: Chen Gang @ 2015-04-23 14:30 UTC (permalink / raw)
  To: Steven Miao; +Cc: Richard Weinberger, bfin, linux-kernel

On 4/23/15 10:51, Steven Miao wrote:
> On Wed, Apr 22, 2015 at 10:32 PM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>> On 4/22/15 17:00, Steven Miao wrote:
>>> Hi,
>>>
>>> On Thu, Apr 9, 2015 at 5:03 AM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>>>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>>>> is too big, it may be overwritten, the related issue:
>>>>
>>>>     LD      init/built-in.o
>>>>   init/built-in.o: In function `do_early_param':
>>>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>> blackfin toolchain generate 24 bit pc-relative calls by default, with
>>> a range of –16,777,216 through 16,777,214 (0xFF00 0000 to 0x00FF FFFE)
>>> is available.
>>> So call to l1_text should be ok. What do you mean the kernel is too big?
>>> http://docs.blackfin.uclinux.org/doku.php?id=ism:call
>>>
>>>
>>
>> Excuse me, I am not quite familiar with what you said above, can we
>> also treat 24-bit as 16MB size limitation for kernel size? I am not
>> quite sure, could you provide more information about it?.
>>
>> And I checked "arch/blackfin/kernel/vmlinux.lds.S", for me, in current
>> case:
> The memory address on blackfin usually starts from 0, if pc = 0, the
> pc relative call range is [0xFF00 0000 - 0xFFFFFFFF, 0 -  0x00FF
> FFFE], it covers L1 space.
> If the kernel is big than 16M, eg. pc = 0x100 0000, the pc relative
> call range accordingly is [0x1 - 0x100 0000, 0x100 0000 - 0x 1FF FFFE
> ], it cann't call to L1 space.

OK, thanks. I guess your meaning is:

 - If the kernel is too big, it may let the pc which wants to call L1
   space fail.

 - So the kernel is too big to cause this issue, but it is nothing with
   'overwritten' in my original patch comments.

 - We can treat it as environments limitation, then can use COMPILE_TEST
   for it. So this patch is still OK, except the related comments need
   be improved (at least need to remove 'overwritten').

>>
>>  - init section is the last section of kernel, l1.text is within init
>>    section, and it is in the fixed address. The other contents before
>>    l1.text are dynamic (depend on kernel size).
>>

I guess, what I said above is meaningless (although it is correct).

>>  - if kernel is too big, the contents before l1.text (the other contents
>>    in .init.text) will override it, so ld reports issues.

I guess, what I said above is incorrect.


Are all of I guesses correct?


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-22 14:32   ` Chen Gang
@ 2015-04-23  2:51     ` Steven Miao
  2015-04-23 14:30       ` Chen Gang
  0 siblings, 1 reply; 21+ messages in thread
From: Steven Miao @ 2015-04-23  2:51 UTC (permalink / raw)
  To: Chen Gang; +Cc: Richard Weinberger, bfin, linux-kernel

On Wed, Apr 22, 2015 at 10:32 PM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
> On 4/22/15 17:00, Steven Miao wrote:
>> Hi,
>>
>> On Thu, Apr 9, 2015 at 5:03 AM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>>> is too big, it may be overwritten, the related issue:
>>>
>>>     LD      init/built-in.o
>>>   init/built-in.o: In function `do_early_param':
>>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>> blackfin toolchain generate 24 bit pc-relative calls by default, with
>> a range of –16,777,216 through 16,777,214 (0xFF00 0000 to 0x00FF FFFE)
>> is available.
>> So call to l1_text should be ok. What do you mean the kernel is too big?
>> http://docs.blackfin.uclinux.org/doku.php?id=ism:call
>>
>>
>
> Excuse me, I am not quite familiar with what you said above, can we
> also treat 24-bit as 16MB size limitation for kernel size? I am not
> quite sure, could you provide more information about it?.
>
> And I checked "arch/blackfin/kernel/vmlinux.lds.S", for me, in current
> case:
The memory address on blackfin usually starts from 0, if pc = 0, the
pc relative call range is [0xFF00 0000 - 0xFFFFFFFF, 0 -  0x00FF
FFFE], it covers L1 space.
If the kernel is big than 16M, eg. pc = 0x100 0000, the pc relative
call range accordingly is [0x1 - 0x100 0000, 0x100 0000 - 0x 1FF FFFE
], it cann't call to L1 space.
>
>  - init section is the last section of kernel, l1.text is within init
>    section, and it is in the fixed address. The other contents before
>    l1.text are dynamic (depend on kernel size).
>
>  - if kernel is too big, the contents before l1.text (the other contents
>    in .init.text) will override it, so ld reports issues.
>
>
> Thanks.
> --
> Chen Gang
>
> Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-22  9:00 ` Steven Miao
@ 2015-04-22 14:32   ` Chen Gang
  2015-04-23  2:51     ` Steven Miao
  0 siblings, 1 reply; 21+ messages in thread
From: Chen Gang @ 2015-04-22 14:32 UTC (permalink / raw)
  To: Steven Miao; +Cc: Richard Weinberger, bfin, linux-kernel

On 4/22/15 17:00, Steven Miao wrote:
> Hi,
> 
> On Thu, Apr 9, 2015 at 5:03 AM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
>> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
>> is too big, it may be overwritten, the related issue:
>>
>>     LD      init/built-in.o
>>   init/built-in.o: In function `do_early_param':
>>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
> blackfin toolchain generate 24 bit pc-relative calls by default, with
> a range of –16,777,216 through 16,777,214 (0xFF00 0000 to 0x00FF FFFE)
> is available.
> So call to l1_text should be ok. What do you mean the kernel is too big?
> http://docs.blackfin.uclinux.org/doku.php?id=ism:call
> 
> 

Excuse me, I am not quite familiar with what you said above, can we
also treat 24-bit as 16MB size limitation for kernel size? I am not
quite sure, could you provide more information about it?.

And I checked "arch/blackfin/kernel/vmlinux.lds.S", for me, in current
case:

 - init section is the last section of kernel, l1.text is within init
   section, and it is in the fixed address. The other contents before
   l1.text are dynamic (depend on kernel size).

 - if kernel is too big, the contents before l1.text (the other contents
   in .init.text) will override it, so ld reports issues.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:03 Chen Gang
  2015-04-08 21:10 ` Chen Gang
@ 2015-04-22  9:00 ` Steven Miao
  2015-04-22 14:32   ` Chen Gang
       [not found] ` <5525994D.6090901@hotmail.com>
  2 siblings, 1 reply; 21+ messages in thread
From: Steven Miao @ 2015-04-22  9:00 UTC (permalink / raw)
  To: Chen Gang; +Cc: Richard Weinberger, bfin, linux-kernel

Hi,

On Thu, Apr 9, 2015 at 5:03 AM, Chen Gang <xili_gchen_5257@hotmail.com> wrote:
> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
> is too big, it may be overwritten, the related issue:
>
>     LD      init/built-in.o
>   init/built-in.o: In function `do_early_param':
>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
blackfin toolchain generate 24 bit pc-relative calls by default, with
a range of –16,777,216 through 16,777,214 (0xFF00 0000 to 0x00FF FFFE)
is available.
So call to l1_text should be ok. What do you mean the kernel is too big?
http://docs.blackfin.uclinux.org/doku.php?id=ism:call


>   init/built-in.o: In function `unknown_bootoption':
>
> blackfin is for embedded system, the size limitition is acceptable, so
> it is not the real world issue, which should be skipped if COMPILE_TEST
> enabled.
>
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  arch/blackfin/Makefile | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
> index 2ece4e3..e5195b4 100644
> --- a/arch/blackfin/Makefile
> +++ b/arch/blackfin/Makefile
> @@ -20,6 +20,9 @@ endif
>  KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
>  KBUILD_CFLAGS_MODULE    += -mlong-calls
>  LDFLAGS                 += -m elf32bfin
> +ifeq ($(CONFIG_COMPILE_TEST),y)
> +LDFLAGS                 += --noinhibit-exec
> +endif
>
>  KBUILD_DEFCONFIG := BF537-STAMP_defconfig
>
> --
> 1.9.3

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-09 13:38       ` Richard Weinberger
@ 2015-04-09 23:14         ` Chen Gang
  0 siblings, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-04-09 23:14 UTC (permalink / raw)
  To: Richard Weinberger, realmz6; +Cc: adi-buildroot-devel, linux-kernel

On 4/9/15 21:38, Richard Weinberger wrote:
> Am 09.04.2015 um 15:28 schrieb Chen Gang:
>> On 4/9/15 05:12, Richard Weinberger wrote:
>>> Am 08.04.2015 um 23:10 schrieb Chen Gang:
>>>>
>>>> After this patch, blackfin can pass allmodconfig building (if we treat
>>>> it as allmodconfig). And next, I shall try to:
>>>>
>>>>  - Send all related patches v2 for blackfin kernel within this month.
>>>>
>>>>  - Fix blackfin gcc/binutils related issues within this month.
>>>
>>> All you do is randomly papering over issues to make the allmodconfig build
>>> somehow proceed.
>>> This is not the correct way to deal with problems.
>>>
>>
>> Still, for me, it is not a good idea to make a conclusion in discussing.
>>
>> For gcc/binutils issues, they are real world issue, they need to be
>> fixed, next (I shall try to fix them within this month).
> 
> I leave that up to the blackfin maintainer.

OK, thanks.

> IMHO this is wrong, you're not fixing a real world issue, all you do is
> making allmodconfig somehow proceed by papering over possible real issues
> which you cannot test as you don't have blackfin hardware.
> 

For me, it is not a real world issue, the user should not let it happen.
It is only about building test (COMPILE_TEST).

And for me, the root cause is:

 - init section is the last section which can be dropped easily.

 - but init section includes l1 section (which may also include sched
   section).

 - l1 section has fixed address. If the kernel is too big, l1 section
   will be overwrite, so ld report "reloc overflow".

Welcome any other ideas, discussions or completions.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-09 13:28     ` Chen Gang
@ 2015-04-09 13:38       ` Richard Weinberger
  2015-04-09 23:14         ` Chen Gang
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Weinberger @ 2015-04-09 13:38 UTC (permalink / raw)
  To: Chen Gang, realmz6; +Cc: adi-buildroot-devel, linux-kernel

Am 09.04.2015 um 15:28 schrieb Chen Gang:
> On 4/9/15 05:12, Richard Weinberger wrote:
>> Am 08.04.2015 um 23:10 schrieb Chen Gang:
>>>
>>> After this patch, blackfin can pass allmodconfig building (if we treat
>>> it as allmodconfig). And next, I shall try to:
>>>
>>>  - Send all related patches v2 for blackfin kernel within this month.
>>>
>>>  - Fix blackfin gcc/binutils related issues within this month.
>>
>> All you do is randomly papering over issues to make the allmodconfig build
>> somehow proceed.
>> This is not the correct way to deal with problems.
>>
> 
> Still, for me, it is not a good idea to make a conclusion in discussing.
> 
> For gcc/binutils issues, they are real world issue, they need to be
> fixed, next (I shall try to fix them within this month).

I leave that up to the blackfin maintainer.
IMHO this is wrong, you're not fixing a real world issue, all you do is
making allmodconfig somehow proceed by papering over possible real issues
which you cannot test as you don't have blackfin hardware.

Thanks,
//richard

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:12   ` Richard Weinberger
@ 2015-04-09 13:28     ` Chen Gang
  2015-04-09 13:38       ` Richard Weinberger
  0 siblings, 1 reply; 21+ messages in thread
From: Chen Gang @ 2015-04-09 13:28 UTC (permalink / raw)
  To: Richard Weinberger, realmz6; +Cc: adi-buildroot-devel, linux-kernel

On 4/9/15 05:12, Richard Weinberger wrote:
> Am 08.04.2015 um 23:10 schrieb Chen Gang:
>>
>> After this patch, blackfin can pass allmodconfig building (if we treat
>> it as allmodconfig). And next, I shall try to:
>>
>>  - Send all related patches v2 for blackfin kernel within this month.
>>
>>  - Fix blackfin gcc/binutils related issues within this month.
> 
> All you do is randomly papering over issues to make the allmodconfig build
> somehow proceed.
> This is not the correct way to deal with problems.
> 

Still, for me, it is not a good idea to make a conclusion in discussing.

For gcc/binutils issues, they are real world issue, they need to be
fixed, next (I shall try to fix them within this month).

Some of my blackfin kernel patches need send v2, I shall send them
next. And others are discussing now. If you do not agree with one of
them, please continue discussing in the related thread.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:10 ` Chen Gang
@ 2015-04-08 21:12   ` Richard Weinberger
  2015-04-09 13:28     ` Chen Gang
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Weinberger @ 2015-04-08 21:12 UTC (permalink / raw)
  To: Chen Gang, realmz6; +Cc: adi-buildroot-devel, linux-kernel

Am 08.04.2015 um 23:10 schrieb Chen Gang:
> 
> After this patch, blackfin can pass allmodconfig building (if we treat
> it as allmodconfig). And next, I shall try to:
> 
>  - Send all related patches v2 for blackfin kernel within this month.
> 
>  - Fix blackfin gcc/binutils related issues within this month.

All you do is randomly papering over issues to make the allmodconfig build
somehow proceed.
This is not the correct way to deal with problems.

Thanks,
//richard

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

* Re: [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
  2015-04-08 21:03 Chen Gang
@ 2015-04-08 21:10 ` Chen Gang
  2015-04-08 21:12   ` Richard Weinberger
  2015-04-22  9:00 ` Steven Miao
       [not found] ` <5525994D.6090901@hotmail.com>
  2 siblings, 1 reply; 21+ messages in thread
From: Chen Gang @ 2015-04-08 21:10 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel


After this patch, blackfin can pass allmodconfig building (if we treat
it as allmodconfig). And next, I shall try to:

 - Send all related patches v2 for blackfin kernel within this month.

 - Fix blackfin gcc/binutils related issues within this month.

Thanks.


On 4/9/15 05:03, Chen Gang wrote:
> l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
> is too big, it may be overwritten, the related issue:
> 
>     LD      init/built-in.o
>   init/built-in.o: In function `do_early_param':
>   init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>   init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
>   init/built-in.o: In function `unknown_bootoption':
> 
> blackfin is for embedded system, the size limitition is acceptable, so
> it is not the real world issue, which should be skipped if COMPILE_TEST
> enabled.
> 
> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  arch/blackfin/Makefile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
> index 2ece4e3..e5195b4 100644
> --- a/arch/blackfin/Makefile
> +++ b/arch/blackfin/Makefile
> @@ -20,6 +20,9 @@ endif
>  KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
>  KBUILD_CFLAGS_MODULE    += -mlong-calls
>  LDFLAGS                 += -m elf32bfin
> +ifeq ($(CONFIG_COMPILE_TEST),y)
> +LDFLAGS                 += --noinhibit-exec
> +endif
>  
>  KBUILD_DEFCONFIG := BF537-STAMP_defconfig
>  
> 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

* [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
@ 2015-04-08 21:07 Chen Gang
  0 siblings, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-04-08 21:07 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel

l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
is too big, it may be overwritten, the related issue:

    LD      init/built-in.o
  init/built-in.o: In function `do_early_param':
  init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/built-in.o: In function `unknown_bootoption':

blackfin is for embedded system, the size limitation is acceptable, so
it is not the real world issue, which should be skipped if COMPILE_TEST
enabled.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 arch/blackfin/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 2ece4e3..e5195b4 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -20,6 +20,9 @@ endif
 KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
 KBUILD_CFLAGS_MODULE    += -mlong-calls
 LDFLAGS                 += -m elf32bfin
+ifeq ($(CONFIG_COMPILE_TEST),y)
+LDFLAGS                 += --noinhibit-exec
+endif
 
 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
 
-- 
1.9.3

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

* [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
@ 2015-04-08 21:05 Chen Gang
  0 siblings, 0 replies; 21+ messages in thread
From: Chen Gang @ 2015-04-08 21:05 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel

l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
is too big, it may be overwritten, the related issue:

    LD      init/built-in.o
  init/built-in.o: In function `do_early_param':
  init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/built-in.o: In function `unknown_bootoption':

blackfin is for embedded system, the size limitation is acceptable, so
it is not the real world issue, which should be skipped if COMPILE_TEST
enabled.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 arch/blackfin/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 2ece4e3..e5195b4 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -20,6 +20,9 @@ endif
 KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
 KBUILD_CFLAGS_MODULE    += -mlong-calls
 LDFLAGS                 += -m elf32bfin
+ifeq ($(CONFIG_COMPILE_TEST),y)
+LDFLAGS                 += --noinhibit-exec
+endif
 
 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
 
-- 
1.9.3

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

* [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled
@ 2015-04-08 21:03 Chen Gang
  2015-04-08 21:10 ` Chen Gang
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Chen Gang @ 2015-04-08 21:03 UTC (permalink / raw)
  To: realmz6, Richard Weinberger; +Cc: adi-buildroot-devel, linux-kernel

l1_text is at L1_CODE_START (e.g. for bf533, 0xff800000). If the kernel
is too big, it may be overwritten, the related issue:

    LD      init/built-in.o
  init/built-in.o: In function `do_early_param':
  init/main.c:(.init.text+0xe0): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/main.c:(.init.text+0x10e): relocation truncated to fit: R_BFIN_PCREL24 against symbol `strcmp' defined in .l1.text section in arch/blackfin/lib/lib.a(strcmp.o)
  init/built-in.o: In function `unknown_bootoption':

blackfin is for embedded system, the size limitition is acceptable, so
it is not the real world issue, which should be skipped if COMPILE_TEST
enabled.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 arch/blackfin/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 2ece4e3..e5195b4 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -20,6 +20,9 @@ endif
 KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
 KBUILD_CFLAGS_MODULE    += -mlong-calls
 LDFLAGS                 += -m elf32bfin
+ifeq ($(CONFIG_COMPILE_TEST),y)
+LDFLAGS                 += --noinhibit-exec
+endif
 
 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
 
-- 
1.9.3

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

end of thread, other threads:[~2015-07-01 15:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08 21:05 [PATCH] blackfin: Makefile: Skip reloc overflow issue when COMPILE_TEST enabled Chen Gang
2015-04-08 21:10 ` Richard Weinberger
2015-04-08 21:16   ` Chen Gang
2015-04-08 21:19     ` Richard Weinberger
2015-04-09 13:15       ` Chen Gang
  -- strict thread matches above, loose matches on Subject: below --
2015-04-08 21:07 Chen Gang
2015-04-08 21:05 Chen Gang
2015-04-08 21:03 Chen Gang
2015-04-08 21:10 ` Chen Gang
2015-04-08 21:12   ` Richard Weinberger
2015-04-09 13:28     ` Chen Gang
2015-04-09 13:38       ` Richard Weinberger
2015-04-09 23:14         ` Chen Gang
2015-04-22  9:00 ` Steven Miao
2015-04-22 14:32   ` Chen Gang
2015-04-23  2:51     ` Steven Miao
2015-04-23 14:30       ` Chen Gang
2015-04-24  8:20         ` Steven Miao
2015-04-24 14:28           ` Chen Gang
     [not found] ` <5525994D.6090901@hotmail.com>
2015-07-01 15:31   ` Chen Gang
2015-07-01 15:36   ` Chen Gang

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.