summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-02-16 19:43:05 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2018-02-16 19:43:05 +0000
commitf0fd291bb861a61fe46f2fd0951cc66a01c596ba (patch)
tree588a83b5b9fe7306214fd6f6d8ec45e089091c5f
parentd82de046e305acd03f93c7829faf7479f500b513 (diff)
downloadfpc-f0fd291bb861a61fe46f2fd0951cc66a01c596ba.tar.gz
* elf header align pa
M compiler/ogelf.pas git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_0@38260 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/ogelf.pas5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/ogelf.pas b/compiler/ogelf.pas
index 8a8ee3388a..5324b8df7d 100644
--- a/compiler/ogelf.pas
+++ b/compiler/ogelf.pas
@@ -1241,7 +1241,7 @@ implementation
{ section data }
layoutsections(datapos);
{ section headers }
- shoffset:=datapos;
+ shoffset:=align(datapos,dword(Sizeof(AInt)));
inc(datapos,(nsections+1)*sizeof(telfsechdr));
{ Write ELF Header }
@@ -1277,6 +1277,9 @@ implementation
writer.writezeros($40-sizeof(header)); { align }
{ Sections }
WriteSectionContent(data);
+
+ { Align header }
+ Writer.Writezeros(Align(Writer.Size,Sizeof(AInt))-Writer.Size);
{ section headers, start with an empty header for sh_undef }
writer.writezeros(sizeof(telfsechdr));
ObjSectionList.ForEachCall(@section_write_sechdr,nil);