Changes to make strip and objcopy work for a.out

This commit is contained in:
kristerw 1998-11-21 22:42:32 +00:00
parent e39ec0adc1
commit b502b56ff5
2 changed files with 33 additions and 1 deletions

View File

@ -44,6 +44,11 @@ MY(callback) (abfd)
unsigned int arch_align_power;
unsigned long arch_align;
#ifdef N_PIC
if (N_PIC(*execp))
abfd->flags |= BFD_PIC;
#endif
/* Calculate the file positions of the parts of a newly read aout header */
obj_textsec (abfd)->_raw_size = N_TXTSIZE(*execp);
@ -613,7 +618,7 @@ const bfd_target MY(vec) =
#endif
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED | BFD_PIC),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
MY_symbol_leading_char,
AR_PAD_CHAR, /* ar_pad_char */

27
gnu/dist/bfd/netbsd.h vendored
View File

@ -34,6 +34,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* NetBSD ZMAGIC has its header in the text segment. */
#define N_HEADER_IN_TEXT(x) 1
/* Determine if this file is compiled as pic code. */
#define N_PIC(exec) ((exec).a_info & 0x40000000)
/* Determine if this is a shared library using the flags. */
#define N_SHARED_LIB(x) (N_DYNAMIC(x))
@ -82,6 +85,14 @@ static boolean MY(write_object_contents) PARAMS ((bfd *abfd));
static boolean netbsd_translate_from_native_sym_flags PARAMS ((bfd *, aout_symbol_type *));
static boolean netbsd_translate_to_native_sym_flags PARAMS ((bfd *, asymbol *, struct external_nlist *));
#define SET_ARCH_MACH(ABFD, EXEC) \
bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0); \
netbsd_choose_reloc_size(ABFD);
static void netbsd_choose_reloc_size (bfd *abfd);
#include "aout/netbsd.h"
#include "aout-target.h"
/* Write an object file.
@ -141,6 +152,22 @@ MY(write_object_contents) (abfd)
return true;
}
/* Determine the size of a relocation entry, based on the architecture */
static void
netbsd_choose_reloc_size (abfd)
bfd *abfd;
{
switch (bfd_get_arch (abfd))
{
case bfd_arch_sparc:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
}
/* Translate an a.out symbol into a BFD symbol. The desc, other, type
and symbol->value fields of CACHE_PTR will be set from the a.out
nlist structure. This function is responsible for setting