This is an archive of the discontinued LLVM Phabricator instance.

Give .note.gnu.build-id section alignment 4
ClosedPublic

Authored by mcgrathr on Oct 13 2017, 4:06 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

mcgrathr created this revision.Oct 13 2017, 4:06 PM
ruiu added a subscriber: ruiu.Oct 15 2017, 1:42 PM

Is there a documentation about this? (I understand there's little hope, but just asking.)

I can see that why we want to align it to 4 bytes. Since the section does not contain 64-bit values even on 64-bit, 32-bit should suffice.

http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section describes alignment of the contents of notes. Maintaining that alignment is obviously impossible if the section is not so aligned.

ruiu added a comment.Oct 15 2017, 5:54 PM

Ah, thanks. It is a good surprise. So, the document says that "In 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array of 8-byte words in the format of the target processor." Maybe you should align it to Config->Wordsize instead of 4?

grimar added a subscriber: grimar.Oct 16 2017, 1:58 AM

Probably needs testcase ?

This revision was automatically updated to reflect the committed changes.