On Mon, Dec 27, 2010 at 8:17 PM, H.J. Lu wrote: > On Mon, Dec 20, 2010 at 4:59 AM, Alan Modra wrote: >> On Fri, Dec 17, 2010 at 11:41:40AM -0800, H.J. Lu wrote: >>> The updated patch with a new testcase. >> >> I think this is a better solution, works on current binutils testsuite, >> the testcases in PR12066, and on kernel builds I tried.  You can >> even describe linker behaviour without too much embarassment. >> >> I added an option to allow people to experiment with a consistent >> linker expression resolver by setting >>  __ld_compatibility = 221 ; >> somewhere in their linker scripts.  This treats numbers and absolute >> symbols as numbers everywhere, the most flexible arrangement since >> you can force a number to be an absolute address by using ABSOLUTE(), >> but you can't do the reverse. >> >>        * ld.texinfo (Expression Section): Describe treatment of numbers >>        and absolute symbols. >>        * ldemul.c (after_open_default): Look up __ld_compatibility. >>        * ldexp.c (fold_name): Convert absolute symbols to numbers when >>        inside output section definitions, or when __ld_compatibility >= 221. >>        (exp_fold_tree_1): Convert numbers to absolute when not in output >>        section definition and __ld_compatibility < 221.  Don't always >>        convert values outside an output section definition to absolute. >>        * ldexp.h (uses_defined): Comment. >>        * ldlang.c (ld_compatibility): New variable. >>        * ldlang.h (ld_compatibility): Declare. >>        * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/beos.em, >>        * emultempl/elf32.em, * emultempl/genelf.em, * emultempl/lnk960.em, >>        * emultempl/m68kcoff.em, * emultempl/mmo.em, * emultempl/pe.em, >>        * emultempl/pep.em, * emultempl/sunos.em, * emultempl/z80.em: Call >>        after_open_default from after_open function. >> > > I am not sure how useful "__ld_compatibility" will be. I don't think we > should change the behaviors of known linker scripts. Those failure > caused by changing behaviors of linker scripts may be hard to debug. > In some cases, changing linker scripts, which have been used for > years, may not be a viable option. > > __ld_compatibility was added without any testcases and its prerequisite caused PR ld/12356. I am checking this patch into the next Linux binutils to fix PR ld/12356. -- H.J. --- ld/ 2011-01-01 H.J. Lu PR ld/12356 Revert 2011-12-20 by Alan Modra . * ld.texinfo (Expression Section): Remove __ld_compatibility. * ldemul.c (after_open_default): Don't check __ld_compatibility. * ldexp.c (fold_name): Likewise. (exp_fold_tree_1): Likewise. * ldlang.c (ld_compatibility): Removed. * ldlang.h (ld_compatibility): Likewise. * emultempl/aix.em (gld${EMULATION_NAME}_after_open): Don't call after_open_default. * emultempl/armcoff.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/beos.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/genelf.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/lnk960.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/mmo.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/pe.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/pep.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/sunos.em (gld${EMULATION_NAME}_after_open): Likewise. * emultempl/z80.em (gld${EMULATION_NAME}_after_open): Likewise. 2011-01-01 H.J. Lu PR ld/12356 * ldlang.c: Revert 2011-12-20 by Alan Modra . * ldexp.h: Likewise. * ldexp.c: Likewise. * ldlang.c: Likewise. ld/testsuite/ 2011-01-01 H.J. Lu PR ld/12356 * ld-scripts/default-script2.d: Revert 2011-12-20 by Alan Modra . * ld-scripts/defined5.d: New. * ld-scripts/defined5.s: Likewise. * ld-scripts/defined5.t: Likewise. * ld-scripts/defined.exp: Run defined5.