Skip to content

Commit eb854ff

Browse files
committed
Add several 1-word .bss fragments for FreeBSD.
1 parent 6063599 commit eb854ff

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/boot/be/elf.ml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,27 @@ let emit_file
16441644
htab_put text_frags None code;
16451645
htab_put rodata_frags None data;
16461646

1647+
if sess.Session.sess_targ = FreeBSD_x86_elf
1648+
then
1649+
(*
1650+
* FreeBSD wants some extra symbols in .bss so its libc can fill
1651+
* them in, I think.
1652+
*)
1653+
List.iter
1654+
(fun x -> htab_put bss_frags (Some x) (WORD (TY_u32, (IMM 0L))))
1655+
[
1656+
"environ";
1657+
"optind";
1658+
"optarg";
1659+
"_CurrentRuneLocale";
1660+
"__stack_chk_guard";
1661+
"__mb_sb_limit";
1662+
"__isthreaded";
1663+
"__stdinp";
1664+
"__stderrp";
1665+
"__stdoutp";
1666+
];
1667+
16471668
Hashtbl.iter
16481669
begin
16491670
fun _ tab ->

0 commit comments

Comments
 (0)