This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Relative expressions and ASSERT


On Mon, Dec 20, 2010 at 4:59 AM, Alan Modra <amodra@gmail.com> 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.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]