[PATCH v3 03/13] Rewrite abi-note.S in C.

Florian Weimer fweimer@redhat.com
Mon May 18 15:28:01 GMT 2020


* Szabolcs Nagy:

> +/* Note: Custom type is used as ElfW(Nhdr) is wrong on 64 bit targets.  */

Are you sure about that?

typedef struct
{
  Elf32_Word n_namesz;			/* Length of the note's name.  */
  Elf32_Word n_descsz;			/* Length of the note's descriptor.  */
  Elf32_Word n_type;			/* Type of the note.  */
} Elf32_Nhdr;

typedef struct
{
  Elf64_Word n_namesz;			/* Length of the note's name.  */
  Elf64_Word n_descsz;			/* Length of the note's descriptor.  */
  Elf64_Word n_type;			/* Type of the note.  */
} Elf64_Nhdr;

The types are the same:

typedef uint32_t Elf32_Word;
typedef uint32_t Elf64_Word;

I admit this is super-confusing.

Thanks,
Florian



More information about the Libc-alpha mailing list