mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-20 14:22:35 +08:00
Fri Oct 23 08:15:56 1992 Ian Lance Taylor (ian@cygnus.com)
* changes to support i386-sysv with shared libraries: * coffcode.h (sec_to_styp_flags): if TWO_DATA_SECS is defined, check for .data2; if _LIB is defined, check for it; map SEC_NEVER_LOAD to STYP_NOLOAD. (styp_to_sec_flags): map STYP_NOLOAD to SEC_NEVER_LOAD. (make_a_section_from_file): if TWO_DATA_SECS, accept .data2. (coff_write_object_contents): force vaddr of .lib to 0; set scnptr if section has contents, not just if it is loadable; if TWO_DATA_SECS, check for .data2 (coff_set_section_contents): set vma of .lib section to number of .lib sections. * coff-i386.c: define TWO_DATA_SECS; use a special CALC_ADDEND; don't define coff_write_armap to bsd_write_armap. * hosts/i386v.h: don't include <utime.h>, since it is not provided by SVR3.2.
This commit is contained in:
@ -1,3 +1,30 @@
|
|||||||
|
Fri Oct 23 08:15:56 1992 Ian Lance Taylor (ian@cygnus.com)
|
||||||
|
|
||||||
|
* changes to support i386-sysv with shared libraries:
|
||||||
|
* coffcode.h (sec_to_styp_flags): if TWO_DATA_SECS is defined,
|
||||||
|
check for .data2; if _LIB is defined, check for it; map
|
||||||
|
SEC_NEVER_LOAD to STYP_NOLOAD.
|
||||||
|
(styp_to_sec_flags): map STYP_NOLOAD to SEC_NEVER_LOAD.
|
||||||
|
(make_a_section_from_file): if TWO_DATA_SECS, accept .data2.
|
||||||
|
(coff_write_object_contents): force vaddr of .lib to 0; set scnptr
|
||||||
|
if section has contents, not just if it is loadable; if
|
||||||
|
TWO_DATA_SECS, check for .data2
|
||||||
|
(coff_set_section_contents): set vma of .lib section to number of
|
||||||
|
.lib sections.
|
||||||
|
* coff-i386.c: define TWO_DATA_SECS; use a special CALC_ADDEND;
|
||||||
|
don't define coff_write_armap to bsd_write_armap.
|
||||||
|
* hosts/i386v.h: don't include <utime.h>, since it is not provided
|
||||||
|
by SVR3.2.
|
||||||
|
|
||||||
|
Thu Oct 22 22:40:20 1992 Brendan Kehoe (brendan@lisa.cygnus.com)
|
||||||
|
|
||||||
|
* solaris2.h: Get the definition of alloca from alloca.h if we
|
||||||
|
aren't using gcc.
|
||||||
|
|
||||||
|
Thu Oct 22 03:07:28 1992 John Gilmore (gnu@cygnus.com)
|
||||||
|
|
||||||
|
* configure.in (i960-*-{aout,bout}): Support these.
|
||||||
|
|
||||||
Wed Oct 21 03:46:34 1992 John Gilmore (gnu@cygnus.com)
|
Wed Oct 21 03:46:34 1992 John Gilmore (gnu@cygnus.com)
|
||||||
|
|
||||||
* config/a29k-aout.mt (DEFAULT_TARGET): Set to one that exists.
|
* config/a29k-aout.mt (DEFAULT_TARGET): Set to one that exists.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Support for the generic parts of most COFF variants, for BFD.
|
/* Support for the generic parts of most COFF variants, for BFD.
|
||||||
Copyright (C) 1990-1991 Free Software Foundation, Inc.
|
Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||||
Written by Cygnus Support.
|
Written by Cygnus Support.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
@ -343,12 +343,20 @@ DEFUN(sec_to_styp_flags, (sec_name, sec_flags),
|
|||||||
return((long)STYP_TEXT);
|
return((long)STYP_TEXT);
|
||||||
} else if (!strcmp(sec_name, _DATA)) {
|
} else if (!strcmp(sec_name, _DATA)) {
|
||||||
return((long)STYP_DATA);
|
return((long)STYP_DATA);
|
||||||
|
#ifdef TWO_DATA_SECS
|
||||||
|
} else if (!strcmp(sec_name, ".data2")) {
|
||||||
|
return((long)STYP_DATA);
|
||||||
|
#endif /* TWO_DATA_SECS */
|
||||||
} else if (!strcmp(sec_name, _BSS)) {
|
} else if (!strcmp(sec_name, _BSS)) {
|
||||||
return((long)STYP_BSS);
|
return((long)STYP_BSS);
|
||||||
#ifdef _COMMENT
|
#ifdef _COMMENT
|
||||||
} else if (!strcmp(sec_name, _COMMENT)) {
|
} else if (!strcmp(sec_name, _COMMENT)) {
|
||||||
return((long)STYP_INFO);
|
return((long)STYP_INFO);
|
||||||
#endif /* _COMMENT */
|
#endif /* _COMMENT */
|
||||||
|
#ifdef _LIB
|
||||||
|
} else if (!strcmp(sec_name, _LIB)) {
|
||||||
|
return((long)STYP_LIB);
|
||||||
|
#endif /* _LIB */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try and figure out what it should be */
|
/* Try and figure out what it should be */
|
||||||
@ -364,6 +372,11 @@ DEFUN(sec_to_styp_flags, (sec_name, sec_flags),
|
|||||||
|
|
||||||
if (styp_flags == 0) styp_flags = STYP_BSS;
|
if (styp_flags == 0) styp_flags = STYP_BSS;
|
||||||
|
|
||||||
|
#ifdef STYP_NOLOAD
|
||||||
|
if (sec_flags & SEC_NEVER_LOAD)
|
||||||
|
styp_flags |= STYP_NOLOAD;
|
||||||
|
#endif
|
||||||
|
|
||||||
return(styp_flags);
|
return(styp_flags);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -379,22 +392,30 @@ DEFUN(styp_to_sec_flags, (styp_flags),
|
|||||||
{
|
{
|
||||||
flagword sec_flags=0;
|
flagword sec_flags=0;
|
||||||
|
|
||||||
|
#ifdef STYP_NOLOAD
|
||||||
|
if (styp_flags & STYP_NOLOAD)
|
||||||
|
{
|
||||||
|
sec_flags |= SEC_NEVER_LOAD;
|
||||||
|
}
|
||||||
|
#endif /* STYP_NOLOAD */
|
||||||
|
|
||||||
if ((styp_flags & STYP_TEXT) || (styp_flags & STYP_DATA))
|
if ((styp_flags & STYP_TEXT) || (styp_flags & STYP_DATA))
|
||||||
{
|
{
|
||||||
sec_flags = SEC_LOAD | SEC_ALLOC;
|
sec_flags |= SEC_LOAD | SEC_ALLOC;
|
||||||
}
|
}
|
||||||
else if (styp_flags & STYP_BSS)
|
else if (styp_flags & STYP_BSS)
|
||||||
{
|
{
|
||||||
sec_flags = SEC_ALLOC;
|
sec_flags |= SEC_ALLOC;
|
||||||
}
|
}
|
||||||
else if (styp_flags & STYP_INFO)
|
else if (styp_flags & STYP_INFO)
|
||||||
{
|
{
|
||||||
sec_flags = SEC_NEVER_LOAD;
|
sec_flags |= SEC_NEVER_LOAD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sec_flags = SEC_ALLOC | SEC_LOAD;
|
sec_flags |= SEC_ALLOC | SEC_LOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STYP_LIT /* A29k readonly text/data section type */
|
#ifdef STYP_LIT /* A29k readonly text/data section type */
|
||||||
if ((styp_flags & STYP_LIT) == STYP_LIT)
|
if ((styp_flags & STYP_LIT) == STYP_LIT)
|
||||||
{
|
{
|
||||||
@ -937,6 +958,12 @@ DEFUN(make_a_section_from_file,(abfd, hdr, target_index),
|
|||||||
name[sizeof (hdr->s_name)] = 0;
|
name[sizeof (hdr->s_name)] = 0;
|
||||||
|
|
||||||
return_section = bfd_make_section(abfd, name);
|
return_section = bfd_make_section(abfd, name);
|
||||||
|
#ifdef TWO_DATA_SECS
|
||||||
|
/* On SCO a file created by the Microsoft assembler can have two
|
||||||
|
.data sections. We use .data2 for the second one. */
|
||||||
|
if (return_section == NULL && strcmp(name, _DATA) == 0)
|
||||||
|
return_section = bfd_make_section(abfd, ".data2");
|
||||||
|
#endif /* TWO_DATA_SECS */
|
||||||
if (return_section == NULL)
|
if (return_section == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -2497,6 +2524,13 @@ DEFUN(coff_write_object_contents,(abfd),
|
|||||||
{
|
{
|
||||||
internal_f.f_nscns ++;
|
internal_f.f_nscns ++;
|
||||||
strncpy(&(section.s_name[0]), current->name, 8);
|
strncpy(&(section.s_name[0]), current->name, 8);
|
||||||
|
#ifdef _LIB
|
||||||
|
/* Always set s_vaddr of .lib to 0. This is right for SVR3.2
|
||||||
|
Ian Taylor <ian@cygnus.com>. */
|
||||||
|
if (strcmp (current->name, _LIB) == 0)
|
||||||
|
section.s_vaddr = 0;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
section.s_vaddr = current->vma + pad;
|
section.s_vaddr = current->vma + pad;
|
||||||
section.s_paddr = current->vma + pad;
|
section.s_paddr = current->vma + pad;
|
||||||
section.s_size = current->_raw_size - pad;
|
section.s_size = current->_raw_size - pad;
|
||||||
@ -2505,7 +2539,7 @@ DEFUN(coff_write_object_contents,(abfd),
|
|||||||
will be 0 too
|
will be 0 too
|
||||||
*/
|
*/
|
||||||
if (current->_raw_size - pad == 0 ||
|
if (current->_raw_size - pad == 0 ||
|
||||||
(current->flags & SEC_LOAD) == 0) {
|
(current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) {
|
||||||
section.s_scnptr = 0;
|
section.s_scnptr = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2526,6 +2560,10 @@ DEFUN(coff_write_object_contents,(abfd),
|
|||||||
text_sec = current;
|
text_sec = current;
|
||||||
} else if (!strcmp(current->name, _DATA)) {
|
} else if (!strcmp(current->name, _DATA)) {
|
||||||
data_sec = current;
|
data_sec = current;
|
||||||
|
#ifdef TWO_DATA_SECS
|
||||||
|
} else if (!strcmp(current->name, ".data2")) {
|
||||||
|
data_sec = current;
|
||||||
|
#endif /* TWO_DATA_SECS */
|
||||||
} else if (!strcmp(current->name, _BSS)) {
|
} else if (!strcmp(current->name, _BSS)) {
|
||||||
bss_sec = current;
|
bss_sec = current;
|
||||||
}
|
}
|
||||||
@ -2747,6 +2785,15 @@ DEFUN(coff_set_section_contents,(abfd, section, location, offset, count),
|
|||||||
if (abfd->output_has_begun == false) /* set by bfd.c handler */
|
if (abfd->output_has_begun == false) /* set by bfd.c handler */
|
||||||
coff_compute_section_file_positions(abfd);
|
coff_compute_section_file_positions(abfd);
|
||||||
|
|
||||||
|
#ifdef _LIB
|
||||||
|
/* If this is a .lib section, bump the vma address so that it
|
||||||
|
winds up being the number of .lib sections output. This is
|
||||||
|
right for SVR3.2. Shared libraries should probably get more
|
||||||
|
generic support. Ian Taylor <ian@cygnus.com>. */
|
||||||
|
if (strcmp (section->name, _LIB) == 0)
|
||||||
|
++section->vma;
|
||||||
|
#endif
|
||||||
|
|
||||||
bfd_seek(abfd, (file_ptr) (section->filepos + offset), SEEK_SET);
|
bfd_seek(abfd, (file_ptr) (section->filepos + offset), SEEK_SET);
|
||||||
|
|
||||||
if (count != 0) {
|
if (count != 0) {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <utime.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
Reference in New Issue
Block a user