2003-04-24 Roland McGrath <roland@redhat.com>
* ldgram.y (phdr_type): Grok PT_TLS and PT_GNU_EH_FRAME names. If a name string is unknown, give an error rather than crashing later.
This commit is contained in:
parent
504c3621cf
commit
d038301c19
14
ld/ldgram.y
14
ld/ldgram.y
@ -990,7 +990,7 @@ phdr_type:
|
||||
{
|
||||
"PT_NULL", "PT_LOAD", "PT_DYNAMIC",
|
||||
"PT_INTERP", "PT_NOTE", "PT_SHLIB",
|
||||
"PT_PHDR"
|
||||
"PT_PHDR", "PT_TLS"
|
||||
};
|
||||
|
||||
s = $1->name.name;
|
||||
@ -1002,6 +1002,18 @@ phdr_type:
|
||||
$$ = exp_intop (i);
|
||||
break;
|
||||
}
|
||||
if (i == sizeof phdr_types / sizeof phdr_types[0])
|
||||
{
|
||||
if (strcmp (s, "PT_GNU_EH_FRAME") == 0)
|
||||
$$ = exp_intop (0x6474e550);
|
||||
else
|
||||
{
|
||||
einfo (_("\
|
||||
%X%P:%S: unknown phdr type `%s' (try integer literal)\n"),
|
||||
s);
|
||||
$$ = exp_intop (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user