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/emultempl/aix.em | 2 ++ ld/emultempl/armcoff.em | 2 ++ ld/emultempl/beos.em | 2 ++ ld/emultempl/elf32.em | 2 ++ ld/emultempl/genelf.em | 2 ++ ld/emultempl/lnk960.em | 2 +- ld/emultempl/m68kcoff.em | 2 ++ ld/emultempl/mmo.em | 1 + ld/emultempl/pe.em | 2 ++ ld/emultempl/pep.em | 2 ++ ld/emultempl/sunos.em | 2 ++ ld/emultempl/z80.em | 2 ++ 12 files changed, 22 insertions(+), 1 deletion(-) (limited to 'ld/emultempl') diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 5ccb25c..60c4fc6 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -608,6 +608,8 @@ gld${EMULATION_NAME}_after_open (void) bfd_boolean r; struct set_info *p; + after_open_default (); + /* Call ldctor_build_sets, after pretending that this is a relocatable link. We do this because AIX requires relocation entries for all references to symbols, even in a final diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index b3cdde9..20bff14 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -133,6 +133,8 @@ gld${EMULATION_NAME}_before_allocation (void) static void gld${EMULATION_NAME}_after_open (void) { + after_open_default (); + if (strstr (bfd_get_target (link_info.output_bfd), "arm") == NULL) { /* The arm backend needs special fields in the output hash structure. diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 370dbac..abd3979 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -376,6 +376,8 @@ gld_${EMULATION_NAME}_set_symbols (void) static void gld_${EMULATION_NAME}_after_open (void) { + after_open_default (); + /* Pass the wacky PE command line options into the output bfd. FIXME: This should be done via a function, rather than by including an internal BFD header. */ diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 34cc82c7..9120f85 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1059,6 +1059,8 @@ gld${EMULATION_NAME}_after_open (void) struct bfd_link_needed_list *needed, *l; struct elf_link_hash_table *htab; + after_open_default (); + htab = elf_hash_table (&link_info); if (!is_elf_hash_table (htab)) return; diff --git a/ld/emultempl/genelf.em b/ld/emultempl/genelf.em index 62af4de..ce416eb 100644 --- a/ld/emultempl/genelf.em +++ b/ld/emultempl/genelf.em @@ -35,6 +35,8 @@ gld${EMULATION_NAME}_after_open (void) asection *sec; asymbol **syms; + after_open_default (); + if (link_info.relocatable) for (ibfd = link_info.input_bfds; ibfd != NULL; ibfd = ibfd->link_next) if ((syms = bfd_get_outsymbols (ibfd)) != NULL diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em index e13233c..7120329 100644 --- a/ld/emultempl/lnk960.em +++ b/ld/emultempl/lnk960.em @@ -265,7 +265,7 @@ struct ld_emulation_xfer_struct ld_lnk960_emulation = lnk960_syslib, lnk960_hll, lnk960_after_parse, - NULL, /* after_open */ + after_open_default, lnk960_after_allocation, lnk960_set_output_arch, lnk960_choose_target, diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em index 276c3b2..b09a223 100644 --- a/ld/emultempl/m68kcoff.em +++ b/ld/emultempl/m68kcoff.em @@ -62,6 +62,8 @@ gld${EMULATION_NAME}_after_open (void) { bfd *abfd; + after_open_default (); + if (! command_line.embedded_relocs || link_info.relocatable) return; diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em index d1a6f14..9b18186 100644 --- a/ld/emultempl/mmo.em +++ b/ld/emultempl/mmo.em @@ -151,6 +151,7 @@ mmo_after_open (void) is->the_bfd); } } + after_open_default (); } EOF diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index df0678d..b4d7a63 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -1219,6 +1219,8 @@ debug_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj) static void gld_${EMULATION_NAME}_after_open (void) { + after_open_default (); + #ifdef DLL_SUPPORT if (pe_dll_extra_pe_debug) { diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 4ab7489..e407296 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -1151,6 +1151,8 @@ debug_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *sect, void *obj) static void gld_${EMULATION_NAME}_after_open (void) { + after_open_default (); + is_underscoring (); #ifdef DLL_SUPPORT if (pep_dll_extra_pe_debug) diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index 5c6c0a6..567b8e2 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.em @@ -366,6 +366,8 @@ gld${EMULATION_NAME}_after_open (void) { struct bfd_link_needed_list *needed, *l; + after_open_default (); + /* We only need to worry about this when doing a final link. */ if (link_info.relocatable || link_info.shared) return; diff --git a/ld/emultempl/z80.em b/ld/emultempl/z80.em index 100ebd0..eeb3213 100644 --- a/ld/emultempl/z80.em +++ b/ld/emultempl/z80.em @@ -79,6 +79,8 @@ gldz80_after_open (void) { unsigned long mach_type; + after_open_default (); + switch (result_mach_type) { case M_Z80STRICT: -- cgit v1.1