NOBITS expansion, for .bss etc
[centaur.git] / src / model / insert.c
index b299391a59577d095e23d27ff3e13de1697c5f66..edfe153ecd8bd71316bf4834d2772c3b1bd59f5c 100644 (file)
@@ -121,6 +121,10 @@ GElf_Xword elfu_mInsertBefore(ElfuElf *me, GElf_Off off, GElf_Xword size)
  *
  * PHDRs will be patched such that everything AFTER off is shifted to
  * higher addresses, making space for the new data in-between.
+ *
+ * CAUTION: This also moves NOBITS sections. If such are present,
+ *          use mExpandNobits() first and then inject at the end of
+ *          the expansion site.
  */
 GElf_Xword elfu_mInsertAfter(ElfuElf *me, GElf_Off off, GElf_Xword size)
 {
@@ -161,7 +165,7 @@ GElf_Xword elfu_mInsertAfter(ElfuElf *me, GElf_Off off, GElf_Xword size)
   }
 
   /* For each LOAD header, find clashing headers that need to be
-     remapped to lower memory areas.
+     remapped to higher memory areas.
    */
   CIRCLEQ_FOREACH(mp, &me->phdrList, elem) {
     if (mp->phdr.p_type == PT_LOAD) {