Summary: | cannot move location counter backwards (from 00000000000067e0 to 0000000000000000) | ||
---|---|---|---|
Product: | binutils | Reporter: | Marcin Juszkiewicz <marcin.juszkiewicz> |
Component: | ld | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexey.zaytsev, bug-binutils |
Priority: | P2 | ||
Version: | 2.21 | ||
Target Milestone: | --- | ||
Host: | x86_64-linux-gnu | Target: | i586-linux-gnu |
Build: | Last reconfirmed: | 2010-09-29 12:08:39 | |
Attachments: |
Coreboot object which fail to link + linker scripts
Seabios object which fail to link + linker script |
Description
Marcin Juszkiewicz
2010-09-27 13:55:15 UTC
Bisected binutils git tree (git://repo.or.cz/binutils.git) and this commit broke it: commit 557189b0dd1f3dec6b00b91b9b0c5459ece72a52 Author: Alan Modra <amodra@bigpond.net.au> Date: Thu Aug 19 05:51:47 2010 +0000 binutils/ * NEWS: Mention change in linker script expression evaluation. ld/ * ld.texinfo (Expression Section): Detail expression evaluation. (Builtin Functions <ADDR>): Correct. (Builtin Functions <LOADADDR>): Don't mention LOADADDR normally the same as ADDR. (Builtin Functions <SEGMENT_START>): Typo fix. * ldexp.c (new_number): New function. (make_abs, exp_get_abs_int): Cope with NULL expld.result.section. (fold_unary <'~', '!', '-'>): Don't make_abs. (fold_binary): Simplify result section logic. Return NULL section for logical ops. (fold_binary <SEGMENT_START>): Use new_rel_from_abs to set value to a consistent result. (fold_name <SIZEOF_HEADERS>): Return new_number, not new_abs. (fold_name <DEFINED, SIZEOF, ALIGNOF, LENGTH, CONSTANT>): Likewise. (fold_name <NAME>): No need to handle absolute symbols differently from relative ones. (fold_name <ORIGIN>): Don't return valid result when lang_first_phase_enum. Return new_rel_from_abs, not new_abs. (exp_fold_tree_1 <etree_value>): Return new_number, not new_rel. (exp_fold_tree_1): Ajust for NULL expld.result.section. When assigning a plain number to dot, assume the value is relative to expld.section. Make terms not in an output section, absolute. * ldlang.c (print_assignment): Fix style nit. (lang_size_sections_1): Cope with NULL expld.result.section. (lang_do_assignments_1): Likewise. ld/testsuite/ * ld-scripts/memory.t: Remove ORIGIN fudge. How to reproduce: $ git clone git://git.linuxtogo.org/home/kevin/seabios.git $ git checkout 94dc9c49c283cd576c25692d17567035557a2505 $ cd seabios $ make V=1 Created attachment 5020 [details]
Coreboot object which fail to link + linker scripts
Minimal set of files from coreboot to get link error reproduced. Extract and
run "test.sh" script.
Created attachment 5021 [details]
Seabios object which fail to link + linker script
Minimal set of files from seabios to get link error reproduced. Extract and run
"test.sh" script.
17:49 hrw@home:coreboot-trunk$ ld --version GNU ld (GNU Binutils for Ubuntu) 2.20.51-system.20101014 This snapshot version allows me to link both coreboot and seabios. Hey, was it actually FIXED? I'm getting an error with the current Debian testing binutils, and it looks very similar. GNU ld (GNU Binutils for Debian) 2.21.0.20110327 $ make Build Kconfig config file Compiling whole program out/ccode.16.s Compiling to assembler out/asm-offsets.s Generating offset file out/asm-offsets.h Compiling (16bit) out/code16.o Compiling whole program out/ccode32flat.o Compiling whole program out/code32seg.o Building ld scripts (version "pre-0.6.3-20110514_013119-zaytsev") Fixed space: 0xe05b-0x10000 total: 8101 slack: 2 Percent slack: 0.0% 16bit size: 39520 32bit segmented size: 1636 32bit flat size: 12380 32bit flat init size: 56992 Linking out/rom16.o out/romlayout16.lds:691 cannot move location counter backwards (from 000000000000ca25 to 000000000000ca0c) make: *** [out/rom16.o] Error 1 Just checked with the latest 2.21 snapshot, works fine, sorry for the noise. |