Revision 0bccf03d
b/linux-user/elfload.c | ||
---|---|---|
186 | 186 |
* - for compatibility with glibc ARCH_DLINFO must always be defined on PPC, |
187 | 187 |
* even if DLINFO_ARCH_ITEMS goes to zero or is undefined. |
188 | 188 |
*/ |
189 |
#define DLINFO_ARCH_ITEMS 3
|
|
189 |
#define DLINFO_ARCH_ITEMS 5
|
|
190 | 190 |
#define ARCH_DLINFO \ |
191 | 191 |
do { \ |
192 |
sp -= DLINFO_ARCH_ITEMS * 2; \ |
|
193 |
NEW_AUX_ENT(0, AT_DCACHEBSIZE, 0x20); \ |
|
194 |
NEW_AUX_ENT(1, AT_ICACHEBSIZE, 0x20); \ |
|
195 |
NEW_AUX_ENT(2, AT_UCACHEBSIZE, 0); \ |
|
192 |
NEW_AUX_ENT(AT_DCACHEBSIZE, 0x20); \ |
|
193 |
NEW_AUX_ENT(AT_ICACHEBSIZE, 0x20); \ |
|
194 |
NEW_AUX_ENT(AT_UCACHEBSIZE, 0); \ |
|
196 | 195 |
/* \ |
197 | 196 |
* Now handle glibc compatibility. \ |
198 | 197 |
*/ \ |
199 |
sp -= 2*2; \ |
|
200 |
NEW_AUX_ENT(0, AT_IGNOREPPC, AT_IGNOREPPC); \ |
|
201 |
NEW_AUX_ENT(1, AT_IGNOREPPC, AT_IGNOREPPC); \ |
|
198 |
NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ |
|
199 |
NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ |
|
202 | 200 |
} while (0) |
203 | 201 |
|
204 | 202 |
static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop) |
... | ... | |
643 | 641 |
if ((unsigned long)csp & 15UL) |
644 | 642 |
sp -= ((unsigned long)csp & 15UL) / sizeof(*sp); |
645 | 643 |
|
646 |
#define NEW_AUX_ENT(nr, id, val) \
|
|
647 |
put_user (id, sp + (nr * 2)); \
|
|
648 |
put_user (val, sp + (nr * 2 + 1))
|
|
649 |
sp -= 2;
|
|
650 |
NEW_AUX_ENT (0, AT_NULL, 0);
|
|
651 |
|
|
652 |
sp -= DLINFO_ITEMS*2;
|
|
653 |
NEW_AUX_ENT( 0, AT_PHDR, (target_ulong)(load_addr + exec->e_phoff));
|
|
654 |
NEW_AUX_ENT( 1, AT_PHENT, (target_ulong)(sizeof (struct elf_phdr)));
|
|
655 |
NEW_AUX_ENT( 2, AT_PHNUM, (target_ulong)(exec->e_phnum));
|
|
656 |
NEW_AUX_ENT( 3, AT_PAGESZ, (target_ulong)(TARGET_PAGE_SIZE));
|
|
657 |
NEW_AUX_ENT( 4, AT_BASE, (target_ulong)(interp_load_addr));
|
|
658 |
NEW_AUX_ENT( 5, AT_FLAGS, (target_ulong)0);
|
|
659 |
NEW_AUX_ENT( 6, AT_ENTRY, load_bias + exec->e_entry);
|
|
660 |
NEW_AUX_ENT( 7, AT_UID, (target_ulong) getuid());
|
|
661 |
NEW_AUX_ENT( 8, AT_EUID, (target_ulong) geteuid());
|
|
662 |
NEW_AUX_ENT( 9, AT_GID, (target_ulong) getgid());
|
|
663 |
NEW_AUX_ENT(11, AT_EGID, (target_ulong) getegid());
|
|
644 |
#define NEW_AUX_ENT(id, val) \ |
|
645 |
sp -= 2; \
|
|
646 |
put_user (id, sp); \
|
|
647 |
put_user (val, sp + 1)
|
|
648 |
NEW_AUX_ENT (AT_NULL, 0); |
|
649 |
|
|
650 |
/* There must be exactly DLINFO_ITEMS entries here. */
|
|
651 |
NEW_AUX_ENT(AT_PHDR, (target_ulong)(load_addr + exec->e_phoff)); |
|
652 |
NEW_AUX_ENT(AT_PHENT, (target_ulong)(sizeof (struct elf_phdr))); |
|
653 |
NEW_AUX_ENT(AT_PHNUM, (target_ulong)(exec->e_phnum)); |
|
654 |
NEW_AUX_ENT(AT_PAGESZ, (target_ulong)(TARGET_PAGE_SIZE)); |
|
655 |
NEW_AUX_ENT(AT_BASE, (target_ulong)(interp_load_addr)); |
|
656 |
NEW_AUX_ENT(AT_FLAGS, (target_ulong)0); |
|
657 |
NEW_AUX_ENT(AT_ENTRY, load_bias + exec->e_entry); |
|
658 |
NEW_AUX_ENT(AT_UID, (target_ulong) getuid()); |
|
659 |
NEW_AUX_ENT(AT_EUID, (target_ulong) geteuid()); |
|
660 |
NEW_AUX_ENT(AT_GID, (target_ulong) getgid()); |
|
661 |
NEW_AUX_ENT(AT_EGID, (target_ulong) getegid()); |
|
664 | 662 |
#ifdef ARCH_DLINFO |
665 | 663 |
/* |
666 | 664 |
* ARCH_DLINFO must come last so platform specific code can enforce |
Also available in: Unified diff