[PATCH] Fix for maximum page size on NTO

Jeff Baker jbaker@qnx.com
Fri Jul 11 15:45:00 GMT 2003


Binutils list got cut out of the loop at some point.

Nicks comments are at the bottom.

> If there's a place in the linker scripts that allows you to specify what
> alignment to use when creating the PT_LOAD segments I'm more than happy to
> use that instead, but I couldn't find it.
> 
> Here's the patch with diff -c3p.  I was doing two things at once and
> forgot, sorry.
> 
> Index: config.bfd
> ===================================================================
> RCS file: /cvs/src/src/bfd/config.bfd,v
> retrieving revision 1.140
> diff -c -3 -p -r1.140 config.bfd
> *** config.bfd	10 Jul 2003 04:44:36 -0000	1.140
> --- config.bfd	11 Jul 2003 14:47:22 -0000
> *************** case "${targ}" in
> *** 159,164 ****
> --- 159,165 ----
>     arm-*-nto* | nto*arm*)
>       targ_defvec=bfd_elf32_littlearm_vec
>       targ_selvecs=bfd_elf32_bigarm_vec
> +     targ_cflags=-D__QNXTARGET__
>       ;;
>     arm-*-riscix*)
>       targ_defvec=riscix_vec
> *************** case "${targ}" in
> *** 944,949 ****
> --- 960,966 ----
>     powerpc-*-nto*)
>       targ_defvec=bfd_elf32_powerpc_vec
>       targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
> +     targ_cflags=-D__QNXTARGET__
>       ;;
>     powerpcle-*-nto*)
>       targ_defvec=bfd_elf32_powerpcle_vec
> *************** case "${targ}" in
> *** 1067,1072 ****
> --- 1084,1090 ----
>       targ_defvec=bfd_elf32_sh_vec
>       targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec
> shcoff_small_vec shlcoff_small_vec"
>       targ_underscore=yes
> +     targ_cflags=-D__QNXTARGET__
>       ;;
>     sh-*-pe)
>       targ_defvec=shlpe_vec
> Index: elf32-arm.h
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf32-arm.h,v
> retrieving revision 1.107
> diff -c -3 -p -r1.107 elf32-arm.h
> *** elf32-arm.h	25 Jun 2003 06:40:22 -0000	1.107
> --- elf32-arm.h	11 Jul 2003 14:47:32 -0000
> *************** elf32_arm_final_write_processing (abfd,
> *** 3699,3705 ****
> 
>   #define ELF_ARCH			bfd_arch_arm
>   #define ELF_MACHINE_CODE		EM_ARM
> ! #define ELF_MAXPAGESIZE			0x8000
> 
>   #define bfd_elf32_bfd_copy_private_bfd_data
> 	elf32_arm_copy_private_bfd_data
>   #define bfd_elf32_bfd_merge_private_bfd_data
> 	elf32_arm_merge_private_bfd_data
> --- 3699,3709 ----
> 
>   #define ELF_ARCH			bfd_arch_arm
>   #define ELF_MACHINE_CODE		EM_ARM
> ! #ifdef __QNXTARGET__
> !   #define ELF_MAXPAGESIZE		0x1000
> ! #else
> !   #define ELF_MAXPAGESIZE		0x8000
> ! #endif
> 
>   #define bfd_elf32_bfd_copy_private_bfd_data
> 	elf32_arm_copy_private_bfd_data
>   #define bfd_elf32_bfd_merge_private_bfd_data
> 	elf32_arm_merge_private_bfd_data
> Index: elf32-ppc.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
> retrieving revision 1.92
> diff -c -3 -p -r1.92 elf32-ppc.c
> *** elf32-ppc.c	8 Jul 2003 13:10:51 -0000	1.92
> --- elf32-ppc.c	11 Jul 2003 14:47:43 -0000
> *************** ppc_elf_final_write_processing (bfd *abf
> *** 6026,6032 ****
>   #define TARGET_BIG_NAME		"elf32-powerpc"
>   #define ELF_ARCH		bfd_arch_powerpc
>   #define ELF_MACHINE_CODE	EM_PPC
> ! #define ELF_MAXPAGESIZE		0x10000
>   #define elf_info_to_howto	ppc_elf_info_to_howto
> 
>   #ifdef  EM_CYGNUS_POWERPC
> --- 6026,6036 ----
>   #define TARGET_BIG_NAME		"elf32-powerpc"
>   #define ELF_ARCH		bfd_arch_powerpc
>   #define ELF_MACHINE_CODE	EM_PPC
> ! #ifdef __QNXTARGET__
> !   #define ELF_MAXPAGESIZE	0x1000
> ! #else
> !   #define ELF_MAXPAGESIZE	0x10000
> ! #endif
>   #define elf_info_to_howto	ppc_elf_info_to_howto
> 
>   #ifdef  EM_CYGNUS_POWERPC
> Index: elf32-sh.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf32-sh.c,v
> retrieving revision 1.84
> diff -c -3 -p -r1.84 elf32-sh.c
> *** elf32-sh.c	4 Jul 2003 08:41:57 -0000	1.84
> --- elf32-sh.c	11 Jul 2003 14:47:49 -0000
> *************** elf32_shlin_grok_psinfo (abfd, note)
> *** 7331,7337 ****
>   #define TARGET_LITTLE_NAME	"elf32-shl"
>   #define ELF_ARCH		bfd_arch_sh
>   #define ELF_MACHINE_CODE	EM_SH
> ! #define ELF_MAXPAGESIZE		128
> 
>   #define elf_symbol_leading_char '_'
> 
> --- 7331,7341 ----
>   #define TARGET_LITTLE_NAME	"elf32-shl"
>   #define ELF_ARCH		bfd_arch_sh
>   #define ELF_MACHINE_CODE	EM_SH
> ! #ifdef __QNXTARGET__
> !   #define ELF_MAXPAGESIZE	0x1000
> ! #else
> !   #define ELF_MAXPAGESIZE	0x80
> ! #endif
> 
>   #define elf_symbol_leading_char '_'
> 
> 
> > -----Original Message-----
> > From: Nick Clifton [mailto:nickc@redhat.com]
> > Sent: July 11, 2003 10:32 AM
> > To: Jeff Baker
> > Subject: Re: [PATCH] Fix for maximum page size on NTO
> >
> > Hi Jeff,
> >
> > > ChangeLog:
> > > 2003-07-11  Jeff Baker  <jbaker@qnx.com>
> > >
> > > 	* bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures.
> > > 	* bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
> > > 	* bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
> > > 	* bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
> >
> > Surely the place to do this in the in the linker scripts ?
> > (ie ld/emulparams/{armnto.sh | shelf_nto.sh | elf32ppcnto}).
> >
> >
> > Also - please could you use the "-c3p" switch to diff when creating
> > your patches ?  Without the context supplied by these swtiches it is
> > very hard to work out what code is being changed, or to apply the
> > patch a few days after it is received and the affected sources have
> > been modified in the meantime.
> >
> > Cheers
> >         Nick



More information about the Binutils mailing list