x86: correct PT_NOTE file position
authorJan Beulich <jbeulich@suse.com>
Fri, 2 Sep 2016 12:18:52 +0000 (14:18 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 2 Sep 2016 12:18:52 +0000 (14:18 +0200)
Program and section headers disagreed about the file offset at which
the build ID note lives.

Reported-by: Sylvain Munaut <s.munaut@whatever-company.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/boot/mkelf32.c

index e66740fc161d02bcedf4fea60262f11755b86796..bcbde1a056129877fd86fabcfba29ddfea5d022d 100644 (file)
@@ -394,7 +394,7 @@ int main(int argc, char **argv)
         note_phdr.p_paddr   = note_base;
         note_phdr.p_filesz  = note_sz;
         note_phdr.p_memsz   = note_sz;
-        note_phdr.p_offset  = offset;
+        note_phdr.p_offset  = RAW_OFFSET + offset;
 
         /* Tack on the .note\0 */
         out_shdr[2].sh_size += sizeof(out_shstrtab_extra);