From eb854ffb4423c053451882fdc204fd717bb07ad4 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 9 Feb 2011 11:31:44 -0800 Subject: Add several 1-word .bss fragments for FreeBSD. --- src/boot/be/elf.ml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/boot/be/elf.ml b/src/boot/be/elf.ml index f17541ee..3cc936c0 100644 --- a/src/boot/be/elf.ml +++ b/src/boot/be/elf.ml @@ -1644,6 +1644,27 @@ let emit_file htab_put text_frags None code; htab_put rodata_frags None data; + if sess.Session.sess_targ = FreeBSD_x86_elf + then + (* + * FreeBSD wants some extra symbols in .bss so its libc can fill + * them in, I think. + *) + List.iter + (fun x -> htab_put bss_frags (Some x) (WORD (TY_u32, (IMM 0L)))) + [ + "environ"; + "optind"; + "optarg"; + "_CurrentRuneLocale"; + "__stack_chk_guard"; + "__mb_sb_limit"; + "__isthreaded"; + "__stdinp"; + "__stderrp"; + "__stdoutp"; + ]; + Hashtbl.iter begin fun _ tab -> -- cgit v1.2.3