PROBLEM:	(Patch ID: OSF365-350086)           (CLD MGO101594/Qar 37210)
********
Putting a cobol object file in a shared library, and linking
an exe aginst that lib results in unexpected behaviour at run-time.

It will now be allowable to have _cobol_main in shared libs as well as the 
call shared  executable.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 29936 )
********
Internal check for object file consistency with a .dynrel and .text interaction
triggered a confusing assertion.
  
The ld assertion has been replaced by a more understandable error msg.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 28274)
********
Eliminated warnings about non-quickstart due to shared library mismatches.  
This warning was deemed too confusing to be emitted by default (especially 
since it is emitted for links of all Fortran, C++, Ada, and Pascal programs).


PROBLEM:        (Patch ID: OSF365-350086)           (CLD UVO103186/QAR 34454)
********
ld crashes with too many GOT entries. The problem occured when there was 
exactly 8190 symbols going into a GOT. If you have 8189 symbols--it will work.  
If you had 8191 symbols trying to be referenced through the GOT--it will also 
work.


PROBLEM:        (Patch ID: OSF365-350086)           (CLD HPXQ75BA6/QAR 35309)
********
ld would core dump when an object file had a bad auxiliary table. 

An assertion was added to ld so it will catch these files.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 33840)
********
ld would core dump -  an internal switch case entry was missing a break for 
some basic type processing.

Missing break statement added.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 28322)
********
ld would core dump when linking a large application.

The hash table scheme for internal file processing had a problem when it 
hashed more than 32K files to the same bucket.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 29272)
********
ld did not handle the case of an archive with no archive header
  
ld now issues a warning.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 37709)
********
linked program would core dump when profiling.

ld was incorrectly marking routines.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 30551)
********
Put checks in to not core dump with bad objects.

   
PROBLEM:        (Patch ID: OSF365-350086)           (QAR 33413)
********
When ld parses -static it didn't do enough error checking to insure its
meaningful to have -static.  A user used -static when they meant -non_shared


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 28452)
********
The strip utility would strip an object with relocations without diagnosing
that fact.  This was due to ld -r setting F_EXEC under certain conditions.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 29519)
********
ld core dumping.

This internal logic problem was due to a special case with an external symbol 
not getting matched up with object file (pmext with a pobj).  Special case
logic was added.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 36744)
********
ld was in an infinte loop due to a bad object file.

Logic was added to Avoid getting stuck in a loop if stBlock symbols are invalid 
in the local  symbol  table.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 37849)
********
ld was changed to allow cross mode to read compressed objects.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 30052)
********
ld outputs erroneous warning messages about exception info when linking modules
with no text region.

  
PROBLEM:        (Patch ID: OSF365-350086)           (QAR 37062)
********
ld generated an assertion in get_ext_map().

This problem appears to be the result of other problems occuring in the
linker prior to the compact relocation code.  The linker is generating
a relocatable image (preserving and updating relocation records), yet
it has not set "relocatable=1" internally.  Thus, we attempt to generate
compact relocation and also preserve regular relocations.  This causes
the problem in the compact code.

The solution was not to adjust relocation record that are relative to undefined
symbols unless we are creating a relocatable image. The compactcode expect
unadjusted relocation records

   
PROBLEM:        (Patch ID: OSF365-350086)           (QAR 30295)
********
Internal ld problem in not properly handling  multiple GPRELLOW relocations
for a single GPHIGH.


PROBLEM:        (Patch ID: OSF365-350086)           (CLD MGO101520/ QAR 37272)
********
ld should call msync before exiting.

Add msync system call in close_output() and have it called only when mmap'ing 
(ie, fix cross mode linker). This is to avoid having the data sit around in the 
ubc for an indefinite period of time.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 35624)
********
ld isnt checking return code from close().

Add code to check the return code from close(), since we cannot detect physical device
write failures when doing mmap'd output, we ought to allow for the fact close() 
may return an error code.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 21873 CL)
********
`ld -m` does not print the map for all sections.

Improved ld's output of its section mapping. 


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 26939)
********
The _edata program location is being set incorrectly.

The _edata program location, documented in the end(3) man page, was being
set incorrectly in an executable built non-shared.  It's address should
be greater than or equal to the address of _fdata and less than or equal
to the address of _fbss. 


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 27810)
********
Ld -hidden fails to hide symbol 

Problem corrected.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 29264)
********
No method to select stat libs when stat and shared libs installed on same dir.

This was added for MicroFocus Cobol  in Platinum Pre-BL7
he new ld options "-no_so" and "-so_archive" have been
added to ld in Platinum pre-bl7.  The -Bstatic and -Bdynamic
options described in the problem statement can be mapped
respectively to -no_so and -so_archive. (Fixed in pre-bl7.)


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 30520)
********
"-taso -shared" can core dump linker.

The problem is in relocate.c in the processing of R_REFLONG.
In the -taso code it dereferences an uninitialized 'pmext'when the relocation is 
local.
  
A fix for the problem has been submitted to Platinum.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 31941)
********
ld causes an initialization order problem for DEC C++ programs
linked -non_shared.  Unlike with -call_shared programs, ld calls __init...
routines in the order that they are found on the ld command line.

DEC C++ constructs static objects by generating __init routines.  The generated
__init routines in the user's code can legally reference static objects [which
have __init routines] in the C++ class library (libcxx.a).  Unfortunately,
since user's .o files appear on the command line before libcxx.a, the user's
__init routines are invoked before the class library __init routines.  Thus
the user's __init routine will reference the class library before the latter ha
been initialized.

To get around this problem, DEC C++ declares a static object in each class
library header file.  The static object's constructor calls a routine that
initializes the class library.  Unfortunately, doing this requires that a call
to the initialization routine be made by every module that includes the header
file.  For large programs, this can result in thousands of unnecessary calls an
significant performance degradation at image startup.

A better solution would be if ld could somehow ensure that the class library's
objects were constructed before the user's objects. 


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 32610)
********
(ld) shared library -init option problem on osf/1 v3.0.

Core dump occurred for external init routine when linking with -no_excpt.

init and fini routines could be located in a shared library and
invoked by the main executable's init driver.  I don't believe we
planned for this to work since the init driver must be able to
pc-relative jumps to the init routines, and a pc-relative jump has
only a 23-bit signed displacement.

Since the symbols being called are not defined in the executable, ld
satisfies the references in the init driver using stubs.  A stub is a
small code sequence that loads a symbol index and calls the loader to
resolve it.  The stub *is* local to the executable, which means that
the pc-relative jump can be made without a problem.

Since we never considered the possibility that stubs would be called
from init drivers, the init and fini drivers are invoked with the
loader's GP as its initial GP value.  As inits and finis are called,
they load their own GP value.  Stubs, on the other hand, need to have
a valid GP value from which to load a GOT(0) value, this is the
address of the loader's lazy_text_resolve() routine.  Any valid GP
will do, except for the loader's.  After the first init routine has
been called, the GP value will be valid.

In this problem test case, the first init called is a stub'ed routine.
Normally, the exception handling init routines are first, but
the -no_excpt linker switch causes them not to be linked in.

This problem has been fixed by establishing an initial GP value
for the init and fini driver routines. 


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 32881)
********
Decc++ needs to allow to build modules from last linked to 1st linked.

The customer requests this option so that software which they have
developed on a Sun which initializes in reverse module order can be
efficiently ported to Alpha/OSF.

To force init routines to run in reverse link order an option has been added - 
you can now use the "-reverse_init_order" linker option.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 33972)
********
Linker produces shared libraries with a bad gp_value entry.

On Digital UNIX (DEC OSF/1) V3.2 and T3.4-1, the linker can be made
to produce shared libraries with a bad (NULL) entry for gp_value.
Whether or not this occurs depends on the order of the link options.
This doesn't seem to effect the operation of the libraries, but
it causes ATOM to fail.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 34742)
********
Bad ld optimization at -o2 for alternate entries.

The problem is that linking -O2 will remove the load of $27
incorrectly when the destination is to an alternate entry point with
the same address as the main entry point. 


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 34923)
********
-X option in the linker strips away language information.

The -x option in the linker strips away language information,
making debugging problematic even with the symbols that remain.  There
can be considerable debugging done with -x level information, provided
the language is available. 


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 35460)
********
Ld does not relocate values of symbols.
 
ld does not relocate values of symbols whose symbol type and symbol class are 
 (stSplit,scText).


PROBLEM:        (Patch ID: OSF365-350086)           (CLD USG-02631/QAR 35475)
********
linker gives 'Internal error in /bin/ld: bad index in get_extmap()'.

Fixed in platinum.
    

PROBLEM:        (Patch ID: OSF365-350086)           (QAR 36631)
********
ld problem with _edata if linking f77 produced .o file.

The _edata program location, documented in the end(3) man page, was being
set incorrectly in an executable built non-shared.  It's address should
be greater than or equal to the address of _fdata and less than or equal
to the address of _fbss. 
duplicate of 26939


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 36793)
********
A shared library built with -check_registry so_locations may dump core
accessing .rdata symbols.  If the shared library grows too big for
it's text to fit in the slot allocated for it in an so_locations file,
ld will move the text of the library to the next available text slot.
It then corrects all the text symbol addresses by adding the
difference of the reserved text slot and the newly allocated text
slot.  The difference is also added to .rdata symbols, but .rdata
symbols are in data not text, so the resulting addresses are invalid.
(Fixed in Platinum BL8.)


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 36794)
********
Strong symbol not preempted when ref'd by weak counterpart.

A simple test case will show that when a strong symbol is referenced
via its weak counterpart the reference cannot be preempted by another
instance of the strong symbol.  This problem only occurs when the
executable and it's shared library dependencies are quickstarted.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 37003)
********
Linker produces bad symtab with -x and -r.

The problem occurs when you compile an application with either -g1 or
-g2 and then link the resulting objects with -r and -x.  The result is
that the procedure table's 'isym' and 'adr' fields are set incorrectly.
This causes problems with tools that consume these broken symbol tables.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 21873)
********
`LD -M` does not print the map for all sections.

This link fails with the error message shown above and no output file
is produced.  There is obviously an assumption in the implementation
of the -m option that the .rdata section always exists.


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 37279)
********
'ld -m fails' when output file has no .rdata section.

This link fails with the error message shown above and no output file
is produced.  There is obviously an assumption in the implementation
of the -m option that the .rdata section always exists. 

a duplicate of QAR 21873


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 38021)
********
Cannot link with stripped shared libraries.

duplicate of 38054


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 38040)
********
ld error -- bad isym in proc table.

The problem occurs when you compile an application with either -g1 or
-g2 and then link the resulting objects with -r and -x.  The result is
that the procedure table's 'isym' and 'adr' fields are set incorrectly.
This causes problems with tools that consume these broken symbol tables.
Duplicate of 37003


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 38054)
********
Cannot link with stripped shared libraries

Duplicate of 38021


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 38063)
********
proc table incorrect for simple c++ program

Duplicate of 37003


PROBLEM:        (Patch ID: OSF365-350086)           (QAR 38334)
********
cant link stripped libs

Duplicate of 38054


PROBLEM:	(QAR #44310)		(Patch ID: OSF365-350168)
********
A call-shared application which overloads a shared library procedure
with an additional implementation of the procedure in the main
executable can "Segmentation fault". The problem may be sensitive to
link order. Linking non-shared should cause the problem to go away. One
may be able to determine that the gp register is incorrectly set.

This problem results from the linker incorrectly determining
that the gp prologue can be "optimized away". You can not work
around this problem by linking debug.

The patched linker correctly determines when this optimization can
be applied. If an application does have this problem, you must install
this patch and re-link to correct the problem.

This problem has proven to be extremely rare.


PROBLEM:	(qar 42274)	(Patch ID: OSF365-360049)
********
Link times increases exponentially when using ld's -hidden option.


PROBLEM:	(qar 43546)	(Patch ID: OSF365-360049)
********
The linker is extremely slow when linking against a large number of .so
 (shared library) files.


PROBLEM:        (QAR 47588)	(Patch ID: OSF365-360073)
********
Linker executes an error exit with chmod() permission problems and certain
data-segment alignments for OMAGIC files.


PROBLEM:        (QAR 48365)	(Patch ID: OSF365-360073)
********
Linker hangs (fails to complete execution).


PROBLEM:	(UVO102899,HPXQ55AE4,qar 43081)  (Patch ID: OSF365-350120)
********
When running a link involving a large number of input objects on a small
memory system, the usability of the system may be impacted by the link
operation.  

This patch makes available the "-nommap" switch to reduce the amount of 
page faults incurred by ld.  The -nommap switch may be used on the cc 
command line, an ld command line or placed in /usr/ccs/lib/cmplrs/comp.config. 
Placing it in comp.config, of course, causes the option to be used on all 
link operations performed on a system.


PROBLEM:        (qar 49301)	(Patch ID: OSF365-350337)
********
This patch fixes a problem where use of "ld -r ..." will change symbol
preemption behavior.  Without this patch, some global relocations can be
converted to locals as an optimization. These locals cannot be preempted.

An undocumented linker option has been added in the patched linker to prevent
this conversion.  This new switch is "ld -no_local_conversion ..."


PROBLEM:        (QAR 53151)     (Patch ID: OSF365-350443)
********
At link-time the linker issues an ASSERT statement from within the
module relocate.c.  This will only be observed for very large applications
that build a final image based on previously linked  'ld -r' object files.

assertion failed: EX at ../../../../../../src/usr/ccs/bin/ld/relocate.c line 2471


PROBLEM:        (QAR 55440)     (Patch ID: OSF365-350443)
********
Hidden/Export Symbol wildcard problem:

A regression was introduced into the linker when -hidden symbol
processing was scaled up to use a hash table.  The wildcard capability
with the "exported_symbol" option was completely lost.  This fix
makes wildcards functional for hidden/export symbols.

An example of wildcard usage that was no longer functional is:

  ld -o libf.so -shared -all -hidden  -exported_symbol 'X500*'  file.o -lc

Any symbol beginning with X500 should be "GLOBAL" not "LOCAL".
To check if a symbol is global use the following odump command
on the library that is produced by  the linker:

  odump -Dt libf.so

Shows the symbol being GLOBAL or LOCAL


PROBLEM:        (QAR 54224)     (Patch ID: OSF365-350443)
********
The linker was improperly rounding -T values to 64K increments even when
linking OMAGIC files, which do not have the same rounding requirements.
It turns out that the check being made in the ld.c was already being
done in layout, so all we really need to do is to remove the bogus check
in ld.c


PROBLEM:        (QAR 55693)     (Patch ID: OSF365-350443)
********
The linker fails to link a c++ program issuing an "ld_munmap error" message.


FILE(s):

/usr/ccs/lib/cmplrs/cc/ld       subset OSFBASE365
CHECKSUM: 61501    792  RCSfile: ld.c           RCS: 4.3.74.7
                        RCSfile: uldgnum.c      RCS: 1.1.13.2
                        RCSfile: ldgetname.c    RCS: 4.3.5.2
                        RCSfile: ldr_atexit.c   RCS: 4.2.9.2
                        RCSfile: ldr_dummy2.c   RCS: 4.2.10.2
                        RCSfile: ldr_status.c   RCS: 4.2.8.3
