/* Process program headers again after load segments are mapped in
case processing requires accessing those segments. Scan program
- headers backward so that PT_NOTE can be skipped if PT_GNU_PROPERTY
- exits. */
+ headers backward since PT_GNU_PROPERTY is close to the end of
+ program headers. */
for (ph = &l->l_phdr[l->l_phnum]; ph != l->l_phdr; --ph)
- switch (ph[-1].p_type)
+ if (ph[-1].p_type == PT_GNU_PROPERTY)
{
- case PT_NOTE:
- _dl_process_pt_note (l, fd, &ph[-1]);
- break;
- case PT_GNU_PROPERTY:
_dl_process_pt_gnu_property (l, fd, &ph[-1]);
break;
}
main_map->l_relro_size = ph->p_memsz;
break;
}
- /* Process program headers again, but scan them backwards so
- that PT_NOTE can be skipped if PT_GNU_PROPERTY exits. */
+ /* Process program headers again, but scan them backwards since
+ PT_GNU_PROPERTY is close to the end of program headers. */
for (const ElfW(Phdr) *ph = &phdr[phnum]; ph != phdr; --ph)
- switch (ph[-1].p_type)
+ if (ph[-1].p_type == PT_GNU_PROPERTY)
{
- case PT_NOTE:
- _dl_process_pt_note (main_map, -1, &ph[-1]);
- break;
- case PT_GNU_PROPERTY:
_dl_process_pt_gnu_property (main_map, -1, &ph[-1]);
break;
}
_dl_gcs_check (m, NULL, dlopen_mode);
}
-static inline void __attribute__ ((always_inline))
-_dl_process_pt_note (struct link_map *l, int fd, const ElfW(Phdr) *ph)
-{
-}
-
static inline int
_dl_process_gnu_property (struct link_map *l, int fd, uint32_t type,
uint32_t datasz, void *data)
{
}
-static inline void __attribute__ ((always_inline))
-_dl_process_pt_note (struct link_map *l, int fd, const ElfW(Phdr) *ph)
-{
-}
-
/* Called for each property in the NT_GNU_PROPERTY_TYPE_0 note of L,
processing of the properties continues until this returns 0. */
static inline int __attribute__ ((always_inline))
l->l_property = lc_property_none;
}
-static inline void __attribute__ ((unused))
-_dl_process_pt_note (struct link_map *l, int fd, const ElfW(Phdr) *ph)
-{
- const ElfW(Nhdr) *note = (const void *) (ph->p_vaddr + l->l_addr);
- _dl_process_property_note (l, note, ph->p_memsz, ph->p_align);
-}
-
static inline int __attribute__ ((always_inline))
_dl_process_gnu_property (struct link_map *l, int fd, uint32_t type,
uint32_t datasz, void *data)