mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 20:29:23 +02:00
* elf section alignment, patch by Florian, mantis #32900
M ogelf.pas git-svn-id: trunk@38251 -
This commit is contained in:
parent
14b14f3bda
commit
9a136836fd
@ -1260,7 +1260,7 @@ implementation
|
|||||||
{ section data }
|
{ section data }
|
||||||
layoutsections(datapos);
|
layoutsections(datapos);
|
||||||
{ section headers }
|
{ section headers }
|
||||||
shoffset:=datapos;
|
shoffset:=align(datapos,dword(Sizeof(AInt)));
|
||||||
inc(datapos,(nsections+1)*sizeof(telfsechdr));
|
inc(datapos,(nsections+1)*sizeof(telfsechdr));
|
||||||
|
|
||||||
{ Write ELF Header }
|
{ Write ELF Header }
|
||||||
@ -1298,6 +1298,9 @@ implementation
|
|||||||
writer.writezeros($40-sizeof(header)); { align }
|
writer.writezeros($40-sizeof(header)); { align }
|
||||||
{ Sections }
|
{ Sections }
|
||||||
WriteSectionContent(data);
|
WriteSectionContent(data);
|
||||||
|
|
||||||
|
{ Align header }
|
||||||
|
Writer.Writezeros(Align(Writer.Size,Sizeof(AInt))-Writer.Size);
|
||||||
{ section headers, start with an empty header for sh_undef }
|
{ section headers, start with an empty header for sh_undef }
|
||||||
writer.writezeros(sizeof(telfsechdr));
|
writer.writezeros(sizeof(telfsechdr));
|
||||||
ObjSectionList.ForEachCall(@section_write_sechdr,nil);
|
ObjSectionList.ForEachCall(@section_write_sechdr,nil);
|
||||||
|
Loading…
Reference in New Issue
Block a user