Index: linkers/rld-outputter.cpp
===================================================================
--- linkers/rld-outputter.cpp	(revision 076d935331399c7abd6bb4f7859d1fd815234307)
+++ linkers/rld-outputter.cpp	(revision a458e271640c6b488749663b01ac128368efb352)
@@ -34,5 +34,5 @@
 
 #include <rld.h>
-#include <rld-compression.h>
+#include <rld-rap.h>
 
 namespace rld
@@ -42,4 +42,5 @@
     const std::string
     script_text (const std::string&        entry,
+                 const std::string&        exit,
                  const files::object_list& dependents,
                  const files::cache&       cache,
@@ -55,7 +56,14 @@
 
       if (rld::verbose () >= RLD_VERBOSE_INFO)
-        std::cout << " e: " << entry << std::endl;
-
-      out << "e: " << entry << std::endl;
+        std::cout << " E: " << entry << std::endl;
+
+      out << "E: " << entry << std::endl;
+
+      if (!exit.empty ())
+      {
+        if (rld::verbose () >= RLD_VERBOSE_INFO)
+          std::cout << " e: " << exit << std::endl;
+        out << "e: " << exit << std::endl;
+      }
 
       for (files::object_list::iterator oi = objects.begin ();
@@ -105,4 +113,5 @@
     metadata_object (files::object&            metadata,
                      const std::string&        entry,
+                     const std::string&        exit,
                      const files::object_list& dependents,
                      const files::cache&       cache)
@@ -111,5 +120,6 @@
         std::cout << "metadata: " << metadata.name ().full () << std::endl;
 
-      const std::string script = script_text (entry, dependents, cache, true);
+      const std::string script =
+        script_text (entry, exit, dependents, cache, true);
 
       metadata.open (true);
@@ -148,4 +158,5 @@
     archive (const std::string&        name,
              const std::string&        entry,
+             const std::string&        exit,
              const files::object_list& dependents,
              const files::cache&       cache)
@@ -161,5 +172,5 @@
       files::object metadata (mdname);
 
-      metadata_object (metadata, entry, dependents, cache);
+      metadata_object (metadata, entry, exit, dependents, cache);
 
       files::object_list dep_copy (dependents);
@@ -178,4 +189,5 @@
     script (const std::string&        name,
             const std::string&        entry,
+            const std::string&        exit,
             const files::object_list& dependents,
             const files::cache&       cache)
@@ -194,5 +206,5 @@
       try
       {
-        out << script_text (entry, dependents, cache, false);
+        out << script_text (entry, exit, dependents, cache, false);
       }
       catch (...)
@@ -206,8 +218,9 @@
 
     void
-    application (const std::string&        name,
-                 const std::string&        entry,
-                 const files::object_list& dependents,
-                 const files::cache&       cache)
+    elf_application (const std::string&        name,
+                     const std::string&        entry,
+                     const std::string&        exit,
+                     const files::object_list& dependents,
+                     const files::cache&       cache)
     {
       if (rld::verbose () >= RLD_VERBOSE_INFO)
@@ -220,8 +233,8 @@
       files::image       app (name);
 
-      header = "RAP,00000000,01.00.00,LZ77,00000000\n";
+      header = "RELF,00000000,0001,none,00000000\n";
       header += '\0';
 
-      script = script_text (entry, dependents, cache, true);
+      script = script_text (entry, exit, dependents, cache, true);
 
       cache.get_objects (objects);
@@ -234,6 +247,4 @@
       #define APP_BUFFER_SIZE  (128 * 1024)
 
-      compress::compressor compressor (app, APP_BUFFER_SIZE);
-
       uint8_t* buffer = 0;
 
@@ -241,6 +252,4 @@
       {
         buffer = new uint8_t[APP_BUFFER_SIZE];
-
-        compressor.write (script.c_str (), script.size ());
 
         for (files::object_list::iterator oi = objects.begin ();
@@ -263,7 +272,7 @@
                 in_size < APP_BUFFER_SIZE ? in_size : APP_BUFFER_SIZE;
 
-              obj.read (buffer, reading);
-
-              compressor.write (buffer, reading);
+              app.write (buffer, obj.read (buffer, reading));
+
+              in_size -= reading;
             }
           }
@@ -280,23 +289,53 @@
       {
         delete [] buffer;
+        app.close ();
         throw;
       }
 
-      compressor.flush ();
+      delete [] buffer;
 
       app.close ();
-
-      delete [] buffer;
-
-      if (rld::verbose () >= RLD_VERBOSE_INFO)
-      {
-        int pcent = (compressor.compressed () * 100) / compressor.transferred ();
-        int premand = (((compressor.compressed () * 1000) + 500) /
-                       compressor.transferred ()) % 10;
-        std::cout << "outputter:application: objects: " << objects.size ()
-                  << ", size: " << compressor.compressed ()
-                  << ", compression: " << pcent << '.' << premand << '%'
-                  << std::endl;
-      }
+    }
+
+    void
+    application (const std::string&        name,
+                 const std::string&        entry,
+                 const std::string&        exit,
+                 const files::object_list& dependents,
+                 const files::cache&       cache,
+                 const symbols::table&     symbols)
+    {
+      if (rld::verbose () >= RLD_VERBOSE_INFO)
+        std::cout << "outputter:application: " << name << std::endl;
+
+      files::object_list dep_copy (dependents);
+      files::object_list objects;
+      std::string        header;
+      std::string        script;
+      files::image       app (name);
+
+      header = "RAP,00000000,0001,LZ77,00000000\n";
+      header += '\0';
+
+      script = script_text (entry, exit, dependents, cache, true);
+
+      cache.get_objects (objects);
+      objects.merge (dep_copy);
+      objects.unique ();
+
+      app.open (true);
+      app.write (header.c_str (), header.size ());
+
+      try
+      {
+        rap::write (app, script, objects, symbols);
+      }
+      catch (...)
+      {
+        app.close ();
+        throw;
+      }
+
+      app.close ();
     }
 
Index: linkers/rld-outputter.h
===================================================================
--- linkers/rld-outputter.h	(revision 076d935331399c7abd6bb4f7859d1fd815234307)
+++ linkers/rld-outputter.h	(revision a458e271640c6b488749663b01ac128368efb352)
@@ -33,17 +33,8 @@
   {
     /**
-     * The types of output.
-     */
-    enum type
-    {
-      ot_script,
-      ot_archive,
-      ot_application
-    };
-
-    /**
      * Output the object file list as a string.
      *
      * @param entry The name of the entry point symbol.
+     * @param exit The name of the exit point symbol.
      * @param dependents The list of dependent object files
      * @param cache The file cache for the link. Includes the object list
@@ -52,4 +43,5 @@
      */
     std::string script_text (const std::string&        entry,
+                             const std::string&        exit,
                              const files::object_list& dependents,
                              const files::cache&       cache);
@@ -60,4 +52,5 @@
      * @param name The name of the archive.
      * @param entry The name of the entry point symbol.
+     * @param exit The name of the exit point symbol.
      * @param dependents The list of dependent object files
      * @param cache The file cache for the link. Includes the object list
@@ -66,4 +59,5 @@
     void archive (const std::string&        name,
                   const std::string&        entry,
+                  const std::string&        exit,
                   const files::object_list& dependents,
                   const files::cache&       cache);
@@ -74,4 +68,5 @@
      * @param name The name of the script.
      * @param entry The name of the entry point symbol.
+     * @param exit The name of the exit point symbol.
      * @param dependents The list of dependent object files
      * @param cache The file cache for the link. Includes the object list
@@ -80,12 +75,30 @@
     void script (const std::string&        name,
                  const std::string&        entry,
+                 const std::string&        exit,
                  const files::object_list& dependents,
                  const files::cache&       cache);
 
     /**
-     * Output the object files as a compressed list of files.
+     * Output the object files in an archive with the metadata.
      *
      * @param name The name of the script.
      * @param entry The name of the entry point symbol.
+     * @param exit The name of the exit point symbol.
+     * @param dependents The list of dependent object files
+     * @param cache The file cache for the link. Includes the object list
+     *              the user requested.
+     */
+    void elf_application (const std::string&        name,
+                          const std::string&        entry,
+                          const std::string&        exit,
+                          const files::object_list& dependents,
+                          const files::cache&       cache);
+
+    /**
+     * Output the object files in an archive with the metadata.
+     *
+     * @param name The name of the script.
+     * @param entry The name of the entry point symbol.
+     * @param exit The name of the exit point symbol.
      * @param dependents The list of dependent object files
      * @param cache The file cache for the link. Includes the object list
@@ -94,6 +107,8 @@
     void application (const std::string&        name,
                       const std::string&        entry,
+                      const std::string&        exit,
                       const files::object_list& dependents,
-                      const files::cache&       cache);
+                      const files::cache&       cache,
+                      const symbols::table&     symbols);
 
   }
