rtld: Use common NT_FREEBSD_* note types introduced in r291909

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
emaste 2015-12-21 22:40:29 +00:00
parent b3a9df8d4c
commit 4dcae4ebeb

View File

@ -1362,22 +1362,22 @@ digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_Addr note_end)
if (note->n_namesz != sizeof(NOTE_FREEBSD_VENDOR) ||
note->n_descsz != sizeof(int32_t))
continue;
if (note->n_type != ABI_NOTETYPE &&
note->n_type != CRT_NOINIT_NOTETYPE)
if (note->n_type != NT_FREEBSD_ABI_TAG &&
note->n_type != NT_FREEBSD_NOINIT_TAG)
continue;
note_name = (const char *)(note + 1);
if (strncmp(NOTE_FREEBSD_VENDOR, note_name,
sizeof(NOTE_FREEBSD_VENDOR)) != 0)
continue;
switch (note->n_type) {
case ABI_NOTETYPE:
case NT_FREEBSD_ABI_TAG:
/* FreeBSD osrel note */
p = (uintptr_t)(note + 1);
p += roundup2(note->n_namesz, sizeof(Elf32_Addr));
obj->osrel = *(const int32_t *)(p);
dbg("note osrel %d", obj->osrel);
break;
case CRT_NOINIT_NOTETYPE:
case NT_FREEBSD_NOINIT_TAG:
/* FreeBSD 'crt does not call init' note */
obj->crt_no_init = true;
dbg("note crt_no_init");