mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 17:31:13 +08:00
Fix hp300bsd entry point problem.
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
Fri Nov 22 08:11:42 1991 John Gilmore (gnu at cygnus.com)
|
Fri Nov 22 08:11:42 1991 John Gilmore (gnu at cygnus.com)
|
||||||
|
|
||||||
|
* aoutx.h (some_aout_object_p): Set the `executable' bit
|
||||||
|
if the entry point is contained in the text segment, even if the
|
||||||
|
text segment is at location 0.
|
||||||
|
|
||||||
* coff-mips.c, coffcode.h: Peter Schauer's patch to kludge in
|
* coff-mips.c, coffcode.h: Peter Schauer's patch to kludge in
|
||||||
nonstandard MIPS sections (.rdata, .sdata, etc).
|
nonstandard MIPS sections (.rdata, .sdata, etc).
|
||||||
|
|
||||||
|
19
bfd/aoutx.h
19
bfd/aoutx.h
@ -270,6 +270,7 @@ DEFUN(NAME(aout,some_aout_object_p),(abfd, execp, callback_to_real_object_p),
|
|||||||
bfd_target *(*callback_to_real_object_p) ())
|
bfd_target *(*callback_to_real_object_p) ())
|
||||||
{
|
{
|
||||||
struct container *rawptr;
|
struct container *rawptr;
|
||||||
|
bfd_target *result;
|
||||||
|
|
||||||
rawptr = (struct container *) bfd_zalloc (abfd, sizeof (struct container));
|
rawptr = (struct container *) bfd_zalloc (abfd, sizeof (struct container));
|
||||||
if (rawptr == NULL) {
|
if (rawptr == NULL) {
|
||||||
@ -286,8 +287,7 @@ DEFUN(NAME(aout,some_aout_object_p),(abfd, execp, callback_to_real_object_p),
|
|||||||
abfd->flags = NO_FLAGS;
|
abfd->flags = NO_FLAGS;
|
||||||
if (execp->a_drsize || execp->a_trsize)
|
if (execp->a_drsize || execp->a_trsize)
|
||||||
abfd->flags |= HAS_RELOC;
|
abfd->flags |= HAS_RELOC;
|
||||||
if (execp->a_entry)
|
/* Setting of EXEC_P has been deferred to the bottom of this function */
|
||||||
abfd->flags |= EXEC_P;
|
|
||||||
if (execp->a_syms)
|
if (execp->a_syms)
|
||||||
abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
|
abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
|
||||||
|
|
||||||
@ -399,7 +399,20 @@ DEFUN(NAME(aout,some_aout_object_p),(abfd, execp, callback_to_real_object_p),
|
|||||||
header, should cope with them in this callback as well. */
|
header, should cope with them in this callback as well. */
|
||||||
#endif /* DOCUMENTATION */
|
#endif /* DOCUMENTATION */
|
||||||
|
|
||||||
return (*callback_to_real_object_p)(abfd);
|
result = (*callback_to_real_object_p)(abfd);
|
||||||
|
|
||||||
|
/* Now that the segment addresses have been worked out, take a better
|
||||||
|
guess at whether the file is executable. If the entry point
|
||||||
|
is within the text segment, assume it is. (This makes files
|
||||||
|
executable even if their entry point address is 0, as long as
|
||||||
|
their text starts at zero.)
|
||||||
|
|
||||||
|
At some point we should probably break down and stat the file and
|
||||||
|
declare it executable if (one of) its 'x' bits are on... */
|
||||||
|
if ((execp->a_entry >= obj_textsec(abfd)->vma) &&
|
||||||
|
(execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->size))
|
||||||
|
abfd->flags |= EXEC_P;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*doc*
|
/*doc*
|
||||||
|
Reference in New Issue
Block a user