From: Wolfgang Denk Date: Thu, 27 Mar 2008 23:14:01 +0100 Subject: [U-Boot-Users] [PATCH] ColdFire: Assign version_string as data section in start.S In-Reply-To: Your message of "Thu, 27 Mar 2008 13:32:29 MST." <4791E710007FEB4BBF83775D787F462F06EAF585@az33exm22.fsl.freescale.net> Message-ID: <20080327221401.9C82D242FC@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <4791E710007FEB4BBF83775D787F462F06EAF585@az33exm22.fsl.freescale.net> you wrote: > > > This is intentional on most architectures. What exactly is your > > problem? > > Apparently, it is not the case in ColdFire compilers. The ColdFire > compilers always put the version_string in text section if .data is not > declared and shows build error in start.S - "unaligned opcodes detected > in executable segment". The PowerPC compiler, however, will put the > version_string in data section either with or without .data declared. No, that's not correct. See for example here: "cpu/mpc8xx/start.S": 85 .text 86 .long 0x27051956 /* U-Boot Magic Number */ 87 .globl version_string 88 version_string: 89 .ascii U_BOOT_VERSION 90 .ascii " (", __DATE__, " - ", __TIME__, ")" 91 .ascii CONFIG_IDENT_STRING, "\0" 92 93 . = EXC_OFF_SYS_RESET 94 .globl _start 95 _start: 96 lis r3, CFG_IMMR at h /* position IMMR */ ... Here we explicitely (and intentionally) place the version string in the text segment. It will NOT be put in the data segment. Maybe just adding some ".align" directive helps? > I am going to re-state the patch to "Fix build error generates by CF > compilers for all CF CPUs" or "Fix version_string not in data section > generates by CF compilers". Will either one of these works for you? I would like to understand the problem first. I feel you might just be missing some alignment... It has been working so far, hasn't it? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de It seems intuitively obvious to me, which means that it might be wrong. -- Chris Torek