Page MenuHomePhabricator

Use uint64_t to store the ELF sh_entsize field.
Needs ReviewPublic

Authored by mattd on Jan 4 2018, 11:10 AM.

Details

Reviewers
rengolin
grosbach
Summary

Use 64bit sizes for sh_entsize.

Elf64_Shdr uses 64bit sizes (Elf64_Xword) to represent the section entry size
(sh_entsize). The internal LLVM representation maintains this field as a 32bit
value, regardless if Elf32 or Elf64. This change ensures that enormous
entsizes (values larger than 2^32) can be represented internally.

Diff Detail

Event Timeline

mattd created this revision.Jan 4 2018, 11:10 AM
mattd added a comment.Jan 12 2018, 3:54 PM

Ping.

I'm not certain how helpful this change is, per some discussion on the list last week, this change implies that linkers can also support extremely large sh_entsize values. The intention with this patch is to represent the same sh_entsize size used in elf.h for 64bit elfs.