anchor.diff:  exports(ExportMap, BaseAddress) ->
     exports(ExportMap, BaseAddress, [], []).
   
  -exports([Offset,M,F,A,IsClosure,IsExported|Rest], BaseAddress, MFAs, Addresses) ->
  +exports([Offset,M,F,A,IsClosure,IsExported|Rest], BaseAddress, MFAs, FunDefs) ->
     case IsExported andalso erlang:is_builtin(M, F, A) of
       true ->
  -      exports(Rest, BaseAddress, MFAs, Addresses);
  +      exports(Rest, BaseAddress, MFAs, FunDefs);
       _false ->
         MFA = {M,F,A},
         Address = BaseAddress + Offset,
         FunDef = #fundef{address=Address, mfa=MFA, is_closure=IsClosure,
   		       is_exported=IsExported},
  -      exports(Rest, BaseAddress, [MFA|MFAs], [FunDef|Addresses])
  +      exports(Rest, BaseAddress, [MFA|MFAs], [FunDef|FunDefs])
     end;
  -exports([], _, MFAs, Addresses) ->
  -  {MFAs, Addresses}.
  +exports([], _, MFAs, FunDefs) ->
  +  {MFAs, FunDefs}.
   
   mod({M,_F,_A}) -> M.
   
   %%------------------------------------------------------------------------
   
  -calculate_addresses(PatchOffsets, Base, Addresses) ->
  +calculate_addresses(PatchOffsets, Base, FunDefs) ->
     RemoteOrLocal = local, % closure code refs are local
     [{Data,
       offsets_to_addresses(Offsets, Base),
  -    get_native_address(DestMFA, Addresses, RemoteOrLocal)} || 
  +    get_native_address(DestMFA, FunDefs, RemoteOrLocal)} ||
       {{DestMFA,_,_}=Data,Offsets} <- PatchOffsets].
   
   offsets_to_addresses(Os, Base) ->
  
positive.code:   patch_instr(Address, hipe_bifs:atom_to_word(Atom), atom).
  
  patch_sdesc(?STACK_DESC(SymExnRA, FSize, Arity, Live),
  	    Address, {_ConstMap2,CodeAddress}, _Addresses) ->
    ExnRA =
      case SymExnRA of
        [] -> 0; % No catch
        LabelOffset -> CodeAddress + LabelOffset
      end,
    ?ASSERT(assert_local_patch(Address)),
    DBG_MFA = ?IF_DEBUG(address_to_mfa_lth(Address, _Addresses), {undefined,undefined,0}),
    hipe_bifs:enter_sdesc({Address, ExnRA, FSize, Arity, Live, DBG_MFA}).
  
  
  %%----------------------------------------------------------------
  %% Handle a 'load_address'-type patch.
  %%
  patch_load_address(Data, Address, ConstAndZone, Addresses) ->
    case Data of
      {local_function,DestMFA} ->
        patch_load_mfa(Address, DestMFA, Addresses, 'local');
      {remote_function,DestMFA} ->
        patch_load_mfa(Address, DestMFA, Addresses, 'remote');
      {constant,Name} ->
        {ConstMap2,_CodeAddress} = ConstAndZone,
        ConstAddress = find_const(Name, ConstMap2),
        patch_instr(Address, ConstAddress, constant);
      {closure,{DestMFA,Uniq,Index}} ->
        patch_closure(DestMFA, Uniq, Index, Address, Addresses);
      {c_const,CConst} ->
        patch_instr(Address, bif_address(CConst), c_const)
    end.
  
  patch_closure(DestMFA, Uniq, Index, Address, Addresses) ->
    case get(hipe_patch_closures) of
      false ->
        []; % This is taken care of when registering the module.
  
negative.code: %% -record(ref, {caller_mfa, address, ref_type, trampoline, remote_or_local}).
  %%
  
  add_ref(CalleeMFA, Address, FunDefs, RefType, Trampoline, RemoteOrLocal) ->
    CallerMFA = address_to_mfa_lth(Address, FunDefs),
    %% just a sanity assertion below
    true = case RemoteOrLocal of
  	   local ->
  