public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFC: Alignment and sizes of .note.ABI-tag and .note.gnu.build-id in 64-bit ELF objects
@ 2017-03-31 17:17 H.J. Lu
  2017-03-31 20:30 ` Nicholas Miell
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 2017-03-31 17:17 UTC (permalink / raw)
  To: Binutils, GNU C Library

According to gABI, in 64-bit objects, each note entry is an array of 8-bye
words in the format of the target processor.  But I got

  [ 2] .note.ABI-tag     NOTE            0000000000000254 000254
000020 00   A  0   0  4
  [ 3] .note.gnu.build-id NOTE            0000000000000274 000274
000024 00   A  0   0  4

on x86-64.  .note.ABI-tag size is 32, but it isn't aligned at 8 bytes.
.note.gnu.build-id size is 36, which isn't multiple of 8 bytes.  Should
they be padded to multiple of 8 bytes and aligned to 8 bytes for 64-bit
objects?

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFC: Alignment and sizes of .note.ABI-tag and .note.gnu.build-id in 64-bit ELF objects
  2017-03-31 17:17 RFC: Alignment and sizes of .note.ABI-tag and .note.gnu.build-id in 64-bit ELF objects H.J. Lu
@ 2017-03-31 20:30 ` Nicholas Miell
  2017-03-31 22:45   ` Nicholas Miell
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Miell @ 2017-03-31 20:30 UTC (permalink / raw)
  To: H.J. Lu, Binutils, GNU C Library

On 03/31/2017 10:17 AM, H.J. Lu wrote:
> According to gABI, in 64-bit objects, each note entry is an array of 8-bye
> words in the format of the target processor.  But I got
>
>   [ 2] .note.ABI-tag     NOTE            0000000000000254 000254
> 000020 00   A  0   0  4
>   [ 3] .note.gnu.build-id NOTE            0000000000000274 000274
> 000024 00   A  0   0  4
>
> on x86-64.  .note.ABI-tag size is 32, but it isn't aligned at 8 bytes.
> .note.gnu.build-id size is 36, which isn't multiple of 8 bytes.  Should
> they be padded to multiple of 8 bytes and aligned to 8 bytes for 64-bit
> objects?
>

The spec is wrong, ELF notes are always arrays of 4-byte words in the 
format of the target processor.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFC: Alignment and sizes of .note.ABI-tag and .note.gnu.build-id in 64-bit ELF objects
  2017-03-31 20:30 ` Nicholas Miell
@ 2017-03-31 22:45   ` Nicholas Miell
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Miell @ 2017-03-31 22:45 UTC (permalink / raw)
  To: binutils; +Cc: libc-alpha

On 03/31/2017 10:17 AM, H.J. Lu wrote:
> According to gABI, in 64-bit objects, each note entry is an array of 8-bye
> words in the format of the target processor.  But I got
>
>   [ 2] .note.ABI-tag     NOTE            0000000000000254 000254
> 000020 00   A  0   0  4
>   [ 3] .note.gnu.build-id NOTE            0000000000000274 000274
> 000024 00   A  0   0  4
>
> on x86-64.  .note.ABI-tag size is 32, but it isn't aligned at 8 bytes.
> .note.gnu.build-id size is 36, which isn't multiple of 8 bytes.  Should
> they be padded to multiple of 8 bytes and aligned to 8 bytes for 64-bit
> objects?
>

The spec is wrong, ELF notes are always arrays of 4-byte words in the 
format of the target processor.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-31 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 17:17 RFC: Alignment and sizes of .note.ABI-tag and .note.gnu.build-id in 64-bit ELF objects H.J. Lu
2017-03-31 20:30 ` Nicholas Miell
2017-03-31 22:45   ` Nicholas Miell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).