* error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain
@ 2012-03-30 22:50 ` Kukjin Kim
0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-03-30 22:50 UTC (permalink / raw)
To: linux-kernel; +Cc: viro, linux-arm-kernel
Hi all,
Occurs following error with arm-eabi-gcc toolchain (gcc version 4.4.3 -
GCC). But there is no error with arm-none-linux-gnueabi-gcc toolchain
(gcc version 4.4.1 - Sourcery G++ Lite 2009q3)...
fs/binfmt_aout.c: In function 'load_aout_binary':
fs/binfmt_aout.c:255: error: 'SEGMENT_SIZE' undeclared (first use in
this function)
fs/binfmt_aout.c:255: error: (Each undeclared identifier is reported
only once
fs/binfmt_aout.c:255: error: for each function it appears in.)
make[2]: *** [fs/binfmt_aout.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [fs] Error 2
Any idea?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread
* error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain
@ 2012-03-30 22:50 ` Kukjin Kim
0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-03-30 22:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
Occurs following error with arm-eabi-gcc toolchain (gcc version 4.4.3 -
GCC). But there is no error with arm-none-linux-gnueabi-gcc toolchain
(gcc version 4.4.1 - Sourcery G++ Lite 2009q3)...
fs/binfmt_aout.c: In function 'load_aout_binary':
fs/binfmt_aout.c:255: error: 'SEGMENT_SIZE' undeclared (first use in
this function)
fs/binfmt_aout.c:255: error: (Each undeclared identifier is reported
only once
fs/binfmt_aout.c:255: error: for each function it appears in.)
make[2]: *** [fs/binfmt_aout.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [fs] Error 2
Any idea?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain
2012-03-30 22:50 ` Kukjin Kim
@ 2012-03-31 4:58 ` Nicolas Pitre
-1 siblings, 0 replies; 6+ messages in thread
From: Nicolas Pitre @ 2012-03-31 4:58 UTC (permalink / raw)
To: Kukjin Kim; +Cc: linux-kernel, viro, linux-arm-kernel
On Fri, 30 Mar 2012, Kukjin Kim wrote:
> Hi all,
>
> Occurs following error with arm-eabi-gcc toolchain (gcc version 4.4.3 -
> GCC). But there is no error with arm-none-linux-gnueabi-gcc toolchain
> (gcc version 4.4.1 - Sourcery G++ Lite 2009q3)...
>
> fs/binfmt_aout.c: In function 'load_aout_binary':
> fs/binfmt_aout.c:255: error: 'SEGMENT_SIZE' undeclared (first use in
> this function)
> fs/binfmt_aout.c:255: error: (Each undeclared identifier is reported
> only once
> fs/binfmt_aout.c:255: error: for each function it appears in.)
> make[2]: *** [fs/binfmt_aout.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [fs] Error 2
>
> Any idea?
Yes. This comes from the N_DATADDR() macro, defined in
include/linux/a.out.h as follows:
|#define N_DATADDR(x) \
| (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
| : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
Then, looking at _N_SEGMENT_ROUND() in the same file:
|#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
Here it is. Now, why isn't SEGMENT_SIZE defined? Well that's where
things get way more hairy than they are already (caution, barf bag
recommended):
|/* Address of data segment in memory after it is loaded.
| Note that it is up to you to define SEGMENT_SIZE
| on machines not listed here. */
|#if defined(vax) || defined(hp300) || defined(pyr)
|#define SEGMENT_SIZE page_size
|#endif
|#ifdef sony
|#define SEGMENT_SIZE 0x2000
|#endif /* Sony. */
|#ifdef is68k
|#define SEGMENT_SIZE 0x20000
|#endif
|#if defined(m68k) && defined(PORTAR)
|#define PAGE_SIZE 0x400
|#define SEGMENT_SIZE PAGE_SIZE
|#endif
|
|#ifdef linux
|#ifdef __KERNEL__
|#include <asm/page.h>
|#else
|#include <unistd.h>
|#endif
|#if defined(__i386__) || defined(__mc68000__)
|#define SEGMENT_SIZE 1024
|#else
|#ifndef SEGMENT_SIZE
|#ifdef __KERNEL__
|#define SEGMENT_SIZE PAGE_SIZE
|#else
|#define SEGMENT_SIZE getpagesize()
|#endif
|#endif
|#endif
|#endif
So the clue you're looking for is probably on the 18th line above.
BTW, no one is using a.out on ARM anymore. You should really consider
removing CONFIG_BINFMT_AOUT from your config.
Nicolas
^ permalink raw reply [flat|nested] 6+ messages in thread
* error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain
@ 2012-03-31 4:58 ` Nicolas Pitre
0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Pitre @ 2012-03-31 4:58 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 30 Mar 2012, Kukjin Kim wrote:
> Hi all,
>
> Occurs following error with arm-eabi-gcc toolchain (gcc version 4.4.3 -
> GCC). But there is no error with arm-none-linux-gnueabi-gcc toolchain
> (gcc version 4.4.1 - Sourcery G++ Lite 2009q3)...
>
> fs/binfmt_aout.c: In function 'load_aout_binary':
> fs/binfmt_aout.c:255: error: 'SEGMENT_SIZE' undeclared (first use in
> this function)
> fs/binfmt_aout.c:255: error: (Each undeclared identifier is reported
> only once
> fs/binfmt_aout.c:255: error: for each function it appears in.)
> make[2]: *** [fs/binfmt_aout.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [fs] Error 2
>
> Any idea?
Yes. This comes from the N_DATADDR() macro, defined in
include/linux/a.out.h as follows:
|#define N_DATADDR(x) \
| (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \
| : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
Then, looking at _N_SEGMENT_ROUND() in the same file:
|#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
Here it is. Now, why isn't SEGMENT_SIZE defined? Well that's where
things get way more hairy than they are already (caution, barf bag
recommended):
|/* Address of data segment in memory after it is loaded.
| Note that it is up to you to define SEGMENT_SIZE
| on machines not listed here. */
|#if defined(vax) || defined(hp300) || defined(pyr)
|#define SEGMENT_SIZE page_size
|#endif
|#ifdef sony
|#define SEGMENT_SIZE 0x2000
|#endif /* Sony. */
|#ifdef is68k
|#define SEGMENT_SIZE 0x20000
|#endif
|#if defined(m68k) && defined(PORTAR)
|#define PAGE_SIZE 0x400
|#define SEGMENT_SIZE PAGE_SIZE
|#endif
|
|#ifdef linux
|#ifdef __KERNEL__
|#include <asm/page.h>
|#else
|#include <unistd.h>
|#endif
|#if defined(__i386__) || defined(__mc68000__)
|#define SEGMENT_SIZE 1024
|#else
|#ifndef SEGMENT_SIZE
|#ifdef __KERNEL__
|#define SEGMENT_SIZE PAGE_SIZE
|#else
|#define SEGMENT_SIZE getpagesize()
|#endif
|#endif
|#endif
|#endif
So the clue you're looking for is probably on the 18th line above.
BTW, no one is using a.out on ARM anymore. You should really consider
removing CONFIG_BINFMT_AOUT from your config.
Nicolas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain
2012-03-31 4:58 ` Nicolas Pitre
@ 2012-04-02 19:14 ` Kukjin Kim
-1 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-04-02 19:14 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Kukjin Kim, linux-kernel, linux-arm-kernel, viro
Nicolas Pitre wrote:
> On Fri, 30 Mar 2012, Kukjin Kim wrote:
>
[...]
Hi Nicolas,
> So the clue you're looking for is probably on the 18th line above.
>
Ah Yep, I see.
> BTW, no one is using a.out on ARM anymore. You should really consider
> removing CONFIG_BINFMT_AOUT from your config.
>
Oh, now s3c2410_defconfig has it. OK, let me fix it.
Thank you for your time and kindly explanation.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread
* error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain
@ 2012-04-02 19:14 ` Kukjin Kim
0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-04-02 19:14 UTC (permalink / raw)
To: linux-arm-kernel
Nicolas Pitre wrote:
> On Fri, 30 Mar 2012, Kukjin Kim wrote:
>
[...]
Hi Nicolas,
> So the clue you're looking for is probably on the 18th line above.
>
Ah Yep, I see.
> BTW, no one is using a.out on ARM anymore. You should really consider
> removing CONFIG_BINFMT_AOUT from your config.
>
Oh, now s3c2410_defconfig has it. OK, let me fix it.
Thank you for your time and kindly explanation.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-04-02 19:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30 22:50 error: 'SEGMENT_SIZE' undeclared with arm-eabi-gcc toolchain Kukjin Kim
2012-03-30 22:50 ` Kukjin Kim
2012-03-31 4:58 ` Nicolas Pitre
2012-03-31 4:58 ` Nicolas Pitre
2012-04-02 19:14 ` Kukjin Kim
2012-04-02 19:14 ` Kukjin Kim
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.