From 5c3049d2ef5d591dadd42bd074f4866616ef8231 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 20 Dec 2010 13:00:14 +0000 Subject: * 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. --- ld/ldemul.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ld/ldemul.c') diff --git a/ld/ldemul.c b/ld/ldemul.c index f1f3979..3c07ceb 100644 --- a/ld/ldemul.c +++ b/ld/ldemul.c @@ -226,6 +226,16 @@ after_parse_default (void) void after_open_default (void) { + struct bfd_link_hash_entry *h; + + h = bfd_wrapped_link_hash_lookup (link_info.output_bfd, + &link_info, + "__ld_compatibility", + FALSE, FALSE, TRUE); + if (h != NULL + && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak)) + ld_compatibility = h->u.def.value; } void -- cgit v1.1