anchor.diff:      {add_module, Name};
   generate_instruction(deleted, File) ->
       Name = list_to_atom(file_to_name(File)),
  -    {delete_module, Name};
  -generate_instruction(changed, {File, _}) ->
  +    {delete_module, Name}.
  +
  +generate_instruction(changed, ModDeps, {File, _}) ->
       {ok, {Name, List}} = beam_lib:chunks(File, [attributes, exports]),
       Behavior = get_behavior(List),
       CodeChange = is_code_change(List),
  -    generate_instruction_advanced(Name, Behavior, CodeChange).
  -
  -generate_instruction_advanced(Name, undefined, undefined) ->
  +    Deps = proplists:get_value(Name, ModDeps, []),
  +    generate_instruction_advanced(Name, Behavior, CodeChange, Deps).
  +
  +generate_instruction_advanced(Name, undefined, undefined, Deps) ->
       %% Not a behavior or code change, assume purely functional
  -    {load_module, Name};
  -generate_instruction_advanced(Name, [supervisor], _) ->
  +    {load_module, Name, Deps};
  +generate_instruction_advanced(Name, [supervisor], _, _) ->
       %% Supervisor
       {update, Name, supervisor};
  -generate_instruction_advanced(Name, _, code_change) ->
  +generate_instruction_advanced(Name, _, code_change, Deps) ->
       %% Includes code_change export
  -    {update, Name, {advanced, []}};
  -generate_instruction_advanced(Name, _, _) ->
  +    {update, Name, {advanced, []}, Deps};
  +generate_instruction_advanced(Name, _, _, Deps) ->
       %% Anything else
  -    {load_module, Name}.
  +    {load_module, Name, Deps}.
   
   get_behavior(List) ->
       Attributes = proplists:get_value(attributes, List),
  
positive.code:     UpgradeApps = genappup_which_apps(Upgraded, AppUpApps),
  
      %% Generate appup files for upgraded apps
      generate_appup_files(NewVerPath, OldVerPath, UpgradeApps),
  
      {ok, Config1}.
  
  
negative.code:     {AddedFiles, DeletedFiles, ChangedFiles} = beam_lib:cmp_dirs(NewEbinDir,
                                                                   OldEbinDir),
  
      ChangedNames = [list_to_atom(file_to_name(F)) || {F, _} <- ChangedFiles],
      ModDeps1 = [{N, [M1 || M1 <- M, lists:member(M1, ChangedNames)]}
                  || {N, M} <- ModDeps],
  
      Added = [generate_instruction(added, File) || File <- AddedFiles],
      Deleted = [generate_instruction(deleted, File) || File <- DeletedFiles],
      Changed = [generate_instruction(changed, ModDeps1, File)
                 || File <- ChangedFiles],
  
      Inst = lists:append([Added, Deleted, Changed]),
  
  