Import binutils 2.11.2.

This commit is contained in:
tv 2001-08-14 02:57:43 +00:00
parent 2e1e353192
commit cb093d3c1d
183 changed files with 5106 additions and 3130 deletions

View File

@ -1,3 +1,86 @@
2001-06-11 Alan Modra <amodra@bigpond.net.au>
Merge from mainline.
2001-05-16 Alexandre Oliva <aoliva@redhat.com>
* gmon_io.c (gmon_io_read, gmon_io_write_vma,
gmon_io_write_32, gmon_io_write_8, gmon_io_write): Adjust
argument list for K&R C.
2001-03-13 David Mosberger <davidm@hpl.hp.com>
* hist.c (hist_dimension): Declare as an array of 16 characters.
(hist_read_rec): If SAMPLEDEBUG, print each histogram bin count.
* basic_blocks.c: Whitespace and formatting changes.
* bb_exit_func.c: Ditto.
* call_graph.c: Ditto.
* call_graph.h: Ditto.
* cg_arcs.c: Ditto.
* cg_print.c: Ditto.
* cg_print.h: Ditto.
* corefile.c: Ditto.
* corefile.h: Ditto.
* gmon_io.c: Ditto.
* gmon_io.h: Ditto.
* gmon_out.h: Ditto.
* gprof.c: Ditto.
* hist.c: Ditto.
* hist.h: Ditto.
* i386.c: Ditto.
* search_list.c: Ditto.
* search_list.h: Ditto.
* source.c: Ditto.
* source.h: Ditto.
* sym_ids.c: Ditto.
* sym_ids.h: Ditto.
* symtab.c: Ditto.
* symtab.h: Ditto.
* tahoe.c: Ditto.
* utils.c: Ditto.
* vax.c: Ditto.
* gmon_out.h (gmon_hist_hdr): Delete.
(gmon_cg_arc_record): Delete.
* gmon_io.c (put_vma): Declare "static".
(get_vma): Ditto.
(gmon_io_write): New function.
(gmon_io_write_8): Ditto.
(gmon_io_write_32): Ditto.
(gmon_io_write_vma): Ditto.
(gmon_io_read): Ditto.
(gmon_io_read_32): Ditto.
(gmon_io_read_vma): Ditto.
* basic_blocks.c (bb_read_rec): Use gmon_io_read* / gmon_io_write*
to read/write data file in a more portable fashion.
(bb_write_blocks): Ditto.
* call_graph.c (cg_read_rec): Ditto.
(cg_write_arcs): Ditto.
* hist.c (hist_read_rec): Ditto.
(hist_write_hist): Ditto.
From Jes Sorensen <jes@linuxcare.com>
* gmon_out.h: Use GMON_PTR_SIZE instead of sizeof(char*).
* gmon.h: Ditto.
* configure.in: Get GMON_PTR_SIZE from existing <sys/gmon_out.h>
if it exists.
* acconfig.h: New file. Mention and document GMON_PTR_SIZE.
* gconfig.h: Regenerate.
* configure: Regenerate.
* Makefile.in: Regenerate.
2001-02-27 Alan Modra <alan@linuxcare.com.au>
* configure.in (BFD_VERSION): New.
(AM_INIT_AUTOMAKE): Use $BFD_VERSION.
* configure: Regenerate.
* gconfig.in: Regenerate.
* Makefile.am: Run "make dep-am"
* Makefile.in: Regenerate.
2001-06-10 Philip Blundell <philb@gnu.org>
* configure.in: Set version to 2.11.1.
* configure: Regenerate.
2001-06-07 Alan Modra <amodra@bigpond.net.au>
* Many files: Update copyright notices.
2001-03-16 Philip Blundell <philb@gnu.org>
* configure: Regenerate.
@ -67,8 +150,8 @@
2000-07-05 Kenneth Block <krblock@computer.org>
* gprof/gprof.c: Add optional style to demangle switch
* gprof/gprof.texi: Document optional style to demangle switch.
* gprof.c: Add optional style to demangle switch
* gprof.texi: Document optional style to demangle switch.
2000-06-05 DJ Delorie <dj@redhat.com>
@ -1304,7 +1387,7 @@ Tue Jan 31 16:18:18 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
-S: annotate source file
-t: set table length (with -S)
* Makefile (OBJS): added basic_blocks.o call_graph.o gmon_io.o
* Makefile.am (OBJS): added basic_blocks.o call_graph.o gmon_io.o
source.o time_hist.o
Fri Jul 1 15:23:50 1994 David Mosberger-Tang (davidm@piston.cs.arizona.edu)
@ -1455,7 +1538,7 @@ Mon Apr 26 12:37:46 1993 Ian Lance Taylor (ian@cygnus.com)
Tue Apr 13 16:14:03 1993 Per Bothner (bothner@cygnus.com)
* M Makefile.in: Add -g to CFLAGS.
* Makefile.in: Add -g to CFLAGS.
Ads LDFLAGS and use in place of CFLAGS where appropriate.
* configure.in: Make a sysdep.hlink in the same way other
bfd-based directories do.

2
gnu/dist/toolchain/gprof/acconfig.h vendored Normal file
View File

@ -0,0 +1,2 @@
/* Define as the size of a pointer in the target profile file format. */
#undef GMON_PTR_SIZE

View File

@ -2,7 +2,7 @@
of basic-block info to/from gmon.out; computing and formatting of
basic-block related statistics.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -58,7 +58,7 @@ DEFUN (cmp_bb, (lp, rp), const void *lp AND const void *rp)
if (left->file && right->file)
{
r = strcmp (left->file->name, right->file->name);
if (r)
return r;
@ -116,18 +116,17 @@ void
DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
{
int nblocks, b;
bfd_vma addr;
unsigned long ncalls;
bfd_vma addr, ncalls;
Sym *sym;
if (fread (&nblocks, sizeof (nblocks), 1, ifp) != 1)
if (gmon_io_read_32 (ifp, &nblocks))
{
fprintf (stderr, _("%s: %s: unexpected end of file\n"), whoami, filename);
fprintf (stderr, _("%s: %s: unexpected end of file\n"),
whoami, filename);
done (1);
}
nblocks = bfd_get_32 (core_bfd, (bfd_byte *) & nblocks);
if (gmon_file_version == 0)
fskip_string (ifp);
@ -136,7 +135,7 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
if (gmon_file_version == 0)
{
int line_num;
/* Version 0 had lots of extra stuff that we don't
care about anymore. */
if ((fread (&ncalls, sizeof (ncalls), 1, ifp) != 1)
@ -149,24 +148,17 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
done (1);
}
}
else
else if (gmon_io_read_vma (ifp, &addr)
|| gmon_io_read_vma (ifp, &ncalls))
{
if (fread (&addr, sizeof (addr), 1, ifp) != 1
|| fread (&ncalls, sizeof (ncalls), 1, ifp) != 1)
{
perror (filename);
done (1);
}
perror (filename);
done (1);
}
/* Basic-block execution counts are meaningful only if we're
profiling at the line-by-line level: */
profiling at the line-by-line level: */
if (line_granularity)
{
/* Convert from target to host endianness: */
addr = get_vma (core_bfd, (bfd_byte *) & addr);
ncalls = bfd_get_32 (core_bfd, (bfd_byte *) &ncalls);
sym = sym_lookup (&symtab, addr);
if (sym)
@ -176,7 +168,7 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
DBG (BBDEBUG,
printf ("[bb_read_rec] 0x%lx->0x%lx (%s:%d) cnt=%lu\n",
(unsigned long) addr, (unsigned long) sym->addr,
sym->name, sym->line_num, ncalls));
sym->name, sym->line_num, (unsigned long) ncalls));
for (i = 0; i < NBBS; i++)
{
@ -211,10 +203,7 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
void
DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename)
{
const unsigned char tag = GMON_TAG_BB_COUNT;
int nblocks = 0;
bfd_vma addr;
unsigned long ncalls;
Sym *sym;
int i;
@ -227,9 +216,8 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename)
}
/* Write header: */
bfd_put_32 (core_bfd, nblocks, (bfd_byte *) & nblocks);
if (fwrite (&tag, sizeof (tag), 1, ofp) != 1
|| fwrite (&nblocks, sizeof (nblocks), 1, ofp) != 1)
if (gmon_io_write_8 (ofp, GMON_TAG_BB_COUNT)
|| gmon_io_write_32 (ofp, nblocks))
{
perror (filename);
done (1);
@ -240,11 +228,8 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename)
{
for (i = 0; i < NBBS && sym->bb_addr[i]; i++)
{
put_vma (core_bfd, sym->bb_addr[i], (bfd_byte *) & addr);
bfd_put_32 (core_bfd, sym->bb_calls[i], (bfd_byte *) & ncalls);
if (fwrite (&addr, sizeof (addr), 1, ofp) != 1
|| fwrite (&ncalls, sizeof (ncalls), 1, ofp) != 1)
if (gmon_io_write_vma (ofp, sym->bb_addr[i])
|| gmon_io_write_vma (ofp, sym->bb_calls[i]))
{
perror (filename);
done (1);
@ -255,8 +240,8 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename)
/* Output basic-block statistics in a format that is easily parseable.
Current the format is:
<filename>:<line-number>: (<function-name>:<bb-addr): <ncalls> */
<filename>:<line-number>: (<function-name>:<bb-addr): <ncalls> */
void
DEFUN_VOID (print_exec_counts)
@ -272,12 +257,12 @@ DEFUN_VOID (print_exec_counts)
/* Sort basic-blocks according to function name and line number: */
sorted_bbs = (Sym **) xmalloc (symtab.len * sizeof (sorted_bbs[0]));
len = 0;
for (sym = symtab.base; sym < symtab.limit; ++sym)
{
/* Accept symbol if it's in the INCL_EXEC table
or there is no INCL_EXEC table
and it does not appear in the EXCL_EXEC table. */
or there is no INCL_EXEC table
and it does not appear in the EXCL_EXEC table. */
if (sym_lookup (&syms[INCL_EXEC], sym->addr)
|| (syms[INCL_EXEC].len == 0
&& !sym_lookup (&syms[EXCL_EXEC], sym->addr)))
@ -285,7 +270,7 @@ DEFUN_VOID (print_exec_counts)
sorted_bbs[len++] = sym;
}
}
qsort (sorted_bbs, len, sizeof (sorted_bbs[0]), cmp_bb);
/* Output basic-blocks: */
@ -299,7 +284,7 @@ DEFUN_VOID (print_exec_counts)
sym->file ? sym->file->name : _("<unknown>"), sym->line_num,
sym->name, (unsigned long) sym->addr, sym->ncalls);
}
for (j = 0; j < NBBS && sym->bb_addr[j]; j ++)
{
if (sym->bb_calls[j] > 0 || ! ignore_zeros)
@ -318,7 +303,7 @@ DEFUN_VOID (print_exec_counts)
/* Helper for bb_annotated_source: format annotation containing
number of line executions. Depends on being called on each
line of a file in sequential order.
Global variable bb_annotate_all_lines enables execution count
compression (counts are supressed if identical to the last one)
and prints counts on all executed lines. Otherwise, print
@ -336,7 +321,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg),
unsigned long last_print = (unsigned long) -1;
b = NULL;
if (line_num <= sf->num_lines)
b = sf->line[line_num - 1];
@ -363,11 +348,11 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg),
ncalls_set = 0;
/* If this is a function entry point, label the line no matter what.
Otherwise, we're in the middle of a function, so check to see
if the first basic-block address is larger than the starting
address of the line. If so, then this line begins with a
a portion of the previous basic-block, so print that prior
execution count (if bb_annotate_all_lines is set). */
Otherwise, we're in the middle of a function, so check to see
if the first basic-block address is larger than the starting
address of the line. If so, then this line begins with a
a portion of the previous basic-block, so print that prior
execution count (if bb_annotate_all_lines is set). */
if (b->is_func)
{
sprintf (p, "%lu", b->ncalls);
@ -388,8 +373,8 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg),
}
/* Loop through all of this line's basic-blocks. For each one,
update last_count, then compress sequential identical counts
(if bb_annotate_all_lines) and print the execution count. */
update last_count, then compress sequential identical counts
(if bb_annotate_all_lines) and print the execution count. */
for (i = 0; i < NBBS && b->bb_addr[i]; i++)
{
@ -413,10 +398,10 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg),
}
/* We're done. If nothing has been printed on this line,
print the last execution count (bb_annotate_all_lines),
which could be from either a previous line (if there were
no BBs on this line), or from this line (if all our BB
counts were compressed out because they were identical). */
print the last execution count (bb_annotate_all_lines),
which could be from either a previous line (if there were
no BBs on this line), or from this line (if all our BB
counts were compressed out because they were identical). */
if (bb_annotate_all_lines && p == tmpbuf)
{
@ -481,9 +466,9 @@ DEFUN_VOID (print_annotated_source)
for (sym = symtab.base; sym < symtab.limit; ++sym)
{
/* Accept symbol if it's file is known, its line number is
bigger than anything we have seen for that file so far and
if it's in the INCL_ANNO table or there is no INCL_ANNO
table and it does not appear in the EXCL_ANNO table. */
bigger than anything we have seen for that file so far and
if it's in the INCL_ANNO table or there is no INCL_ANNO
table and it does not appear in the EXCL_ANNO table. */
if (sym->file && sym->line_num > sym->file->num_lines
&& (sym_lookup (&syms[INCL_ANNO], sym->addr)
|| (syms[INCL_ANNO].len == 0
@ -513,7 +498,7 @@ DEFUN_VOID (print_annotated_source)
{
sym->file->ncalls += sym->ncalls;
line_stats = sym->file->line[sym->line_num - 1];
if (!line_stats)
{
/* Common case has at most one basic-block per source line: */
@ -543,7 +528,7 @@ DEFUN_VOID (print_annotated_source)
continue;
num_executable_lines = num_lines_executed = 0;
ofp = annotate_source (sf, 16, annotate_with_count, sf);
if (!ofp)
continue;
@ -556,14 +541,14 @@ DEFUN_VOID (print_annotated_source)
/* Abuse line arrays---it's not needed anymore: */
qsort (sf->line, sf->num_lines, sizeof (sf->line[0]), cmp_ncalls);
table_len = bb_table_length;
if (table_len > sf->num_lines)
table_len = sf->num_lines;
for (i = 0; i < table_len; ++i)
{
sym = sf->line[i];
if (!sym || sym->ncalls == 0)
break;
@ -588,7 +573,7 @@ DEFUN_VOID (print_annotated_source)
num_executable_lines
? (double) sf->ncalls / (double) num_executable_lines
: 0.0);
if (ofp != stdout)
fclose (ofp);
}

View File

@ -1,5 +1,5 @@
/* basic_blocks.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -1,7 +1,7 @@
/* bb_exit_func.c - dumps all the basic-block statistics linked into
the bb_head chain to .d files.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -30,64 +30,64 @@
#include "gmon_out.h"
/* structure emitted by -a */
struct bb {
long zero_word;
const char *filename;
long *counts;
long ncounts;
struct bb *next;
const unsigned long *addresses;
struct bb
{
long zero_word;
const char *filename;
long *counts;
long ncounts;
struct bb *next;
const unsigned long *addresses;
};
struct bb *__bb_head = (struct bb *)0;
struct bb *__bb_head = (struct bb *) 0;
void
__bb_exit_func (void)
{
const int version = GMON_VERSION;
struct gmon_hdr ghdr;
struct bb *ptr;
FILE *fp;
/*
* GEN_GMON_CNT_FILE should be defined on systems with mcleanup()
* functions that do not write basic-block to gmon.out. In such
* cases profiling with "-pg -a" would result in a gmon.out file
* without basic-block info (because the file written here would
* be overwritten. Thus, a separate file is generated instead.
* The two files can easily be combined by specifying them
* on gprof's command line (and possibly generating a gmon.sum
* file with "gprof -s").
*/
const int version = GMON_VERSION;
struct gmon_hdr ghdr;
struct bb *ptr;
FILE *fp;
/* GEN_GMON_CNT_FILE should be defined on systems with mcleanup()
functions that do not write basic-block to gmon.out. In such
cases profiling with "-pg -a" would result in a gmon.out file
without basic-block info (because the file written here would be
overwritten. Thus, a separate file is generated instead. The
two files can easily be combined by specifying them on gprof's
command line (and possibly generating a gmon.sum file with "gprof
-s"). */
#ifndef GEN_GMON_CNT_FILE
# define OUT_NAME "gmon.out"
#else
# define OUT_NAME "gmon.cnt"
#endif
fp = fopen(OUT_NAME, "wb");
if (!fp) {
perror(OUT_NAME);
return;
} /* if */
memcpy(&ghdr.cookie[0], GMON_MAGIC, 4);
memcpy(&ghdr.version, &version, sizeof(version));
fwrite(&ghdr, sizeof(ghdr), 1, fp);
fp = fopen (OUT_NAME, "wb");
if (!fp)
{
perror (OUT_NAME);
return;
}
memcpy (&ghdr.cookie[0], GMON_MAGIC, 4);
memcpy (&ghdr.version, &version, sizeof (version));
fwrite (&ghdr, sizeof (ghdr), 1, fp);
for (ptr = __bb_head; ptr != 0; ptr = ptr->next) {
u_int ncounts = ptr->ncounts;
u_char tag;
u_int i;
for (ptr = __bb_head; ptr != 0; ptr = ptr->next)
{
u_int ncounts = ptr->ncounts;
u_char tag;
u_int i;
tag = GMON_TAG_BB_COUNT;
fwrite(&tag, sizeof(tag), 1, fp);
fwrite(&ncounts, sizeof(ncounts), 1, fp);
tag = GMON_TAG_BB_COUNT;
fwrite (&tag, sizeof (tag), 1, fp);
fwrite (&ncounts, sizeof (ncounts), 1, fp);
for (i = 0; i < ncounts; ++i) {
fwrite(&ptr->addresses[i], sizeof(ptr->addresses[0]), 1, fp);
fwrite(&ptr->counts[i], sizeof(ptr->counts[0]), 1, fp);
} /* for */
} /* for */
fclose (fp);
} /* __bb_exit_func */
/*** end of __bb_exit_func.c ***/
for (i = 0; i < ncounts; ++i)
{
fwrite (&ptr->addresses[i], sizeof (ptr->addresses[0]), 1, fp);
fwrite (&ptr->counts[i], sizeof (ptr->counts[0]), 1, fp);
}
}
fclose (fp);
}

View File

@ -2,6 +2,25 @@
# This script converts a "bb.out" file into a format
# suitable for processing by gprof
#
# Copyright 2001 Free Software Foundation, Inc.
#
# This file is part of GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Write a new-style gmon header

View File

@ -1,6 +1,6 @@
/* call_graph.c - Create call graphs.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -46,7 +46,7 @@ DEFUN (cg_tally, (from_pc, self_pc, count),
line number in the calling routing, but the child should always
point to a function entry point, so we back up in the symbol
table until we find it.
For normal profiling, is_func will be set on all symbols, so this
code will do nothing. */
while (child >= symtab.base && ! child->is_func)
@ -78,22 +78,21 @@ void
DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename)
{
bfd_vma from_pc, self_pc;
struct gmon_cg_arc_record arc;
unsigned long count;
unsigned int count;
if (fread (&arc, sizeof (arc), 1, ifp) != 1)
if (gmon_io_read_vma (ifp, &from_pc)
|| gmon_io_read_vma (ifp, &self_pc)
|| gmon_io_read_32 (ifp, &count))
{
fprintf (stderr, _("%s: %s: unexpected end of file\n"),
whoami, filename);
done (1);
}
from_pc = get_vma (core_bfd, (bfd_byte *) arc.from_pc);
self_pc = get_vma (core_bfd, (bfd_byte *) arc.self_pc);
count = bfd_get_32 (core_bfd, (bfd_byte *) arc.count);
DBG (SAMPLEDEBUG,
printf ("[cg_read_rec] frompc 0x%lx selfpc 0x%lx count %lu\n",
(unsigned long) from_pc, (unsigned long) self_pc, count));
(unsigned long) from_pc, (unsigned long) self_pc,
(unsigned long) count));
/* Add this arc: */
cg_tally (from_pc, self_pc, count);
}
@ -105,8 +104,6 @@ DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename)
void
DEFUN (cg_write_arcs, (ofp, filename), FILE * ofp AND const char *filename)
{
const unsigned char tag = GMON_TAG_CG_ARC;
struct gmon_cg_arc_record raw_arc;
Arc *arc;
Sym *sym;
@ -114,11 +111,10 @@ DEFUN (cg_write_arcs, (ofp, filename), FILE * ofp AND const char *filename)
{
for (arc = sym->cg.children; arc; arc = arc->next_child)
{
put_vma (core_bfd, arc->parent->addr, (bfd_byte *) raw_arc.from_pc);
put_vma (core_bfd, arc->child->addr, (bfd_byte *) raw_arc.self_pc);
bfd_put_32 (core_bfd, arc->count, (bfd_byte *) raw_arc.count);
if (fwrite (&tag, sizeof (tag), 1, ofp) != 1
|| fwrite (&raw_arc, sizeof (raw_arc), 1, ofp) != 1)
if (gmon_io_write_8 (ofp, GMON_TAG_CG_ARC)
|| gmon_io_write_vma (ofp, arc->parent->addr)
|| gmon_io_write_vma (ofp, arc->child->addr)
|| gmon_io_write_32 (ofp, arc->count))
{
perror (filename);
done (1);

View File

@ -1,6 +1,6 @@
/* call_graph.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1983 Regents of the University of California.
* Copyright (c) 1983, 2001 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -102,7 +102,7 @@ DEFUN (arc_add, (parent, child, count),
if (maxarcs == 0)
maxarcs = 1;
maxarcs *= 2;
/* Allocate the new array. */
newarcs = (Arc **)xmalloc(sizeof (Arc *) * maxarcs);

View File

@ -1,6 +1,6 @@
/* cg_print.c - Print routines for displaying call graphs.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -47,7 +47,7 @@ DEFUN_VOID (print_header)
first_output = FALSE;
else
printf ("\f\n");
if (!bsd_style_output)
{
if (print_descriptions)
@ -55,21 +55,21 @@ DEFUN_VOID (print_header)
else
printf (_("\t\t\tCall graph\n\n"));
}
printf (_("\ngranularity: each sample hit covers %ld byte(s)"),
(long) hist_scale * sizeof (UNIT));
if (print_time > 0.0)
printf (_(" for %.2f%% of %.2f seconds\n\n"),
100.0 / print_time, print_time / hz);
else
{
printf (_(" no time propagated\n\n"));
/* This doesn't hurt, since all the numerators will be 0.0. */
print_time = 1.0;
}
if (bsd_style_output)
{
printf ("%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n",
@ -100,7 +100,7 @@ DEFUN (print_cycle, (cyc), Sym * cyc)
: "%-6.6s %5.1f %7.2f %7.2f %7lu", buf,
100 * (cyc->cg.prop.self + cyc->cg.prop.child) / print_time,
cyc->cg.prop.self / hz, cyc->cg.prop.child / hz, cyc->ncalls);
if (cyc->cg.self_calls != 0)
printf ("+%-7lu", cyc->cg.self_calls);
else
@ -141,22 +141,22 @@ static void
DEFUN (sort_members, (cyc), Sym * cyc)
{
Sym *todo, *doing, *prev;
/* Detach cycle members from cyclehead,
and insertion sort them back on. */
todo = cyc->cg.cyc.next;
cyc->cg.cyc.next = 0;
for (doing = todo; doing && doing->cg.cyc.next; doing = todo)
{
todo = doing->cg.cyc.next;
for (prev = cyc; prev->cg.cyc.next; prev = prev->cg.cyc.next)
{
if (cmp_member (doing, prev->cg.cyc.next) == GREATERTHAN)
break;
}
doing->cg.cyc.next = prev->cg.cyc.next;
prev->cg.cyc.next = doing;
}
@ -170,7 +170,7 @@ DEFUN (print_members, (cyc), Sym * cyc)
Sym *member;
sort_members (cyc);
for (member = cyc->cg.cyc.next; member; member = member->cg.cyc.next)
{
printf (bsd_style_output
@ -178,7 +178,7 @@ DEFUN (print_members, (cyc), Sym * cyc)
: "%6.6s %5.5s %7.2f %7.2f %7lu",
"", "", member->cg.prop.self / hz, member->cg.prop.child / hz,
member->ncalls);
if (member->cg.self_calls != 0)
printf ("+%-7lu", member->cg.self_calls);
else
@ -191,12 +191,12 @@ DEFUN (print_members, (cyc), Sym * cyc)
}
/* Compare two arcs to/from the same child/parent.
- if one arc is a self arc, it's least.
- if one arc is within a cycle, it's less than.
- if both arcs are within a cycle, compare arc counts.
- if neither arc is within a cycle, compare with
time + child_time as major key
arc count as minor key. */
- if one arc is a self arc, it's least.
- if one arc is within a cycle, it's less than.
- if both arcs are within a cycle, compare arc counts.
- if neither arc is within a cycle, compare with
time + child_time as major key
arc count as minor key. */
static int
DEFUN (cmp_arc, (left, right), Arc * left AND Arc * right)
@ -222,7 +222,7 @@ DEFUN (cmp_arc, (left, right), Arc * left AND Arc * right)
right->count, right_child->ncalls);
printf ("\n");
);
if (left_parent == left_child)
return LESSTHAN; /* Left is a self call. */
@ -265,7 +265,7 @@ DEFUN (cmp_arc, (left, right), Arc * left AND Arc * right)
/* Neither is a call within a cycle. */
left_time = left->time + left->child_time;
right_time = right->time + right->child_time;
if (left_time < right_time)
return LESSTHAN;
@ -291,12 +291,12 @@ DEFUN (sort_parents, (child), Sym * child)
/* Unlink parents from child, then insertion sort back on to
sorted's parents.
*arc the arc you have detached and are inserting.
*detached the rest of the arcs to be sorted.
sorted arc list onto which you insertion sort.
*prev arc before the arc you are comparing. */
*arc the arc you have detached and are inserting.
*detached the rest of the arcs to be sorted.
sorted arc list onto which you insertion sort.
*prev arc before the arc you are comparing. */
sorted.next_parent = 0;
for (arc = child->cg.parents; arc; arc = detached)
{
detached = arc->next_parent;
@ -307,7 +307,7 @@ DEFUN (sort_parents, (child), Sym * child)
if (cmp_arc (arc, prev->next_parent) != GREATERTHAN)
break;
}
arc->next_parent = prev->next_parent;
prev->next_parent = arc;
}
@ -328,7 +328,7 @@ DEFUN (print_parents, (child), Sym * child)
cycle_head = child->cg.cyc.head;
else
cycle_head = child;
if (!child->cg.parents)
{
printf (bsd_style_output
@ -337,9 +337,9 @@ DEFUN (print_parents, (child), Sym * child)
"", "", "", "", "", "");
return;
}
sort_parents (child);
for (arc = child->cg.parents; arc; arc = arc->next_parent)
{
parent = arc->parent;
@ -375,15 +375,15 @@ static void
DEFUN (sort_children, (parent), Sym * parent)
{
Arc *arc, *detached, sorted, *prev;
/* Unlink children from parent, then insertion sort back on to
sorted's children.
*arc the arc you have detached and are inserting.
*detached the rest of the arcs to be sorted.
sorted arc list onto which you insertion sort.
*prev arc before the arc you are comparing. */
*arc the arc you have detached and are inserting.
*detached the rest of the arcs to be sorted.
sorted arc list onto which you insertion sort.
*prev arc before the arc you are comparing. */
sorted.next_child = 0;
for (arc = parent->cg.children; arc; arc = detached)
{
detached = arc->next_child;
@ -394,7 +394,7 @@ DEFUN (sort_children, (parent), Sym * parent)
if (cmp_arc (arc, prev->next_child) != LESSTHAN)
break;
}
arc->next_child = prev->next_child;
prev->next_child = arc;
}
@ -412,7 +412,7 @@ DEFUN (print_children, (parent), Sym * parent)
sort_children (parent);
arc = parent->cg.children;
for (arc = parent->cg.children; arc; arc = arc->next_child)
{
child = arc->child;
@ -454,11 +454,11 @@ DEFUN (print_line, (np), Sym * np)
: "%-6.6s %5.1f %7.2f %7.2f", buf,
100 * (np->cg.prop.self + np->cg.prop.child) / print_time,
np->cg.prop.self / hz, np->cg.prop.child / hz);
if ((np->ncalls + np->cg.self_calls) != 0)
{
printf (" %7lu", np->ncalls);
if (np->cg.self_calls != 0)
printf ("+%-7lu ", np->cg.self_calls);
else
@ -468,7 +468,7 @@ DEFUN (print_line, (np), Sym * np)
{
printf (" %7.7s %7.7s ", "", "");
}
print_name (np);
printf ("\n");
}
@ -490,14 +490,14 @@ DEFUN (cg_print, (timesortsym), Sym ** timesortsym)
for (index = 0; index < symtab.len + num_cycles; ++index)
{
parent = timesortsym[index];
if ((ignore_zeros && parent->ncalls == 0
&& parent->cg.self_calls == 0 && parent->cg.prop.self == 0
&& parent->cg.prop.child == 0)
|| !parent->cg.print_flag
|| (line_granularity && ! parent->is_func))
continue;
if (!parent->name && parent->cg.cyc.num != 0)
{
/* Cycle header. */
@ -510,18 +510,18 @@ DEFUN (cg_print, (timesortsym), Sym ** timesortsym)
print_line (parent);
print_children (parent);
}
if (bsd_style_output)
printf ("\n");
printf ("-----------------------------------------------\n");
if (bsd_style_output)
printf ("\n");
}
free (timesortsym);
if (print_descriptions && !bsd_style_output)
fsf_callg_blurb (stdout);
}
@ -547,11 +547,11 @@ DEFUN_VOID (cg_print_index)
const char *filename;
char buf[20];
int column_width = (output_width - 1) / 3; /* Don't write in last col! */
/* Now, sort regular function name
alphabetically to create an index. */
name_sorted_syms = (Sym **) xmalloc ((symtab.len + num_cycles) * sizeof (Sym *));
for (index = 0, nnames = 0; index < symtab.len; index++)
{
if (ignore_zeros && symtab.base[index].ncalls == 0
@ -560,25 +560,25 @@ DEFUN_VOID (cg_print_index)
name_sorted_syms[nnames++] = &symtab.base[index];
}
qsort (name_sorted_syms, nnames, sizeof (Sym *), cmp_name);
for (index = 1, todo = nnames; index <= num_cycles; index++)
name_sorted_syms[todo++] = &cycle_header[index];
printf ("\f\n");
printf (_("Index by function name\n\n"));
index = (todo + 2) / 3;
for (i = 0; i < index; i++)
{
col = 0;
starting_col = 0;
for (j = i; j < todo; j += index)
{
sym = name_sorted_syms[j];
if (sym->cg.print_flag)
sprintf (buf, "[%d]", sym->cg.index);
else
@ -593,27 +593,27 @@ DEFUN_VOID (cg_print_index)
else
{
col += strlen (buf);
for (; col < starting_col + 5; ++col)
putchar (' ');
printf (" %s ", buf);
col += print_name_only (sym);
if (!line_granularity && sym->is_static && sym->file)
{
filename = sym->file->name;
if (!print_path)
{
filename = strrchr (filename, '/');
if (filename)
++filename;
else
filename = sym->file->name;
}
printf (" (%s)", filename);
col += strlen (filename) + 3;
}
@ -638,13 +638,13 @@ DEFUN_VOID (cg_print_index)
col += strlen (buf);
}
}
starting_col += column_width;
}
printf ("\n");
}
free (name_sorted_syms);
}
@ -714,7 +714,7 @@ DEFUN (cmp_fun_nuses, (left, right), const PTR left AND const PTR right)
Of course, profiling errors, machine limitations (PA long calls), and
poor cutoff values for the placement algorithm may limit the usefullness
of the resulting function order. Improvements would be greatly appreciated.
Suggestions:
* Place the functions with many callers near the middle of the
@ -749,7 +749,7 @@ DEFUN (cmp_fun_nuses, (left, right), const PTR left AND const PTR right)
ordering which shares the same arc placement algorithm with
the function ordering code (in fact it is a degenerate case
of function ordering). */
void
DEFUN_VOID (cg_print_function_ordering)
{
@ -856,13 +856,13 @@ DEFUN_VOID (cg_print_function_ordering)
Unfortunately, we don't know all these functions
until we're done. So we keep track of all the arcs
to the functions we care about, then prune out those
which are uninteresting.
which are uninteresting.
An interesting variation would be to quit when we found
multi-call site functions which account for some percentage
of the arcs. */
arc = sym->cg.children;
while (arc)
{
if (arc->parent != arc->child)
@ -872,7 +872,7 @@ DEFUN_VOID (cg_print_function_ordering)
}
arc = sym->cg.parents;
while (arc)
{
if (arc->parent != arc->child)
@ -992,7 +992,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all,
total_arcs = 0;
tmp_arcs = 0;
for (index = 0; index < numarcs; index++)
{
Sym *sym1, *sym2;
@ -1049,7 +1049,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all,
prev = prev->prev;
prev_count++;
}
/* Choose the closest. */
child = next_count < prev_count ? next : prev;
}
@ -1263,5 +1263,5 @@ DEFUN_VOID (cg_print_file_ordering)
if (index2 == symtab.len)
printf ("%s\n", symbol_map[index].file_name);
last = symbol_map[index].file_name;
}
}
}

View File

@ -1,6 +1,6 @@
/* cg_print.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,10 @@ AC_INIT(gprof.c)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
AM_INIT_AUTOMAKE(gprof, 2.11)
changequote(,)dnl
BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
changequote([,])dnl
AM_INIT_AUTOMAKE(gprof, ${BFD_VERSION})
AM_PROG_LIBTOOL
@ -26,6 +29,33 @@ CY_GNU_GETTEXT
AM_MAINTAINER_MODE
AC_EXEEXT
AC_CHECK_HEADERS(sys/gmon_out.h)
AC_MSG_CHECKING(the size of gmon pointers)
AC_TRY_RUN([#include <stdio.h>
#include <stdlib.h>
#if HAVE_SYS_GMON_OUT_H
#include <sys/gmon_out.h>
#endif
main()
{
#if HAVE_SYS_GMON_OUT_H
struct gmon_cg_arc_record arc;
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", sizeof(arc.from_pc));
exit(0);
#else
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", (int) sizeof(char *));
exit(1);
#endif
}], gmon_ptr_size=`cat conftestval`, gmon_ptr_size=4, gmon_ptr_size=4)
AC_MSG_RESULT($gmon_ptr_size)
AC_DEFINE_UNQUOTED(GMON_PTR_SIZE, $gmon_ptr_size)
build_warnings="-W -Wall"
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],

View File

@ -1,6 +1,6 @@
/* corefile.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -43,6 +43,9 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define as the size of a pointer in the target profile file format. */
#undef GMON_PTR_SIZE
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@ -103,6 +106,9 @@
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/gmon_out.h> header file. */
#undef HAVE_SYS_GMON_OUT_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
@ -112,18 +118,6 @@
/* Define if you have the <values.h> header file. */
#undef HAVE_VALUES_H
/* Define if you have the stpcpy function */
#undef HAVE_STPCPY
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if NLS is requested */
#undef ENABLE_NLS
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Name of package */
#undef PACKAGE

View File

@ -1,6 +1,6 @@
/* gmon_io.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -49,8 +49,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern int gmon_input; /* What input did we see? */
extern int gmon_file_version; /* File version are we dealing with. */
extern bfd_vma get_vma PARAMS ((bfd *, bfd_byte *));
extern void put_vma PARAMS ((bfd *, bfd_vma, bfd_byte *));
extern int gmon_io_read_vma PARAMS ((FILE *ifp, bfd_vma *valp));
extern int gmon_io_read_32 PARAMS ((FILE *ifp, unsigned int *valp));
extern int gmon_io_read PARAMS ((FILE *ifp, char *buf, size_t n));
extern int gmon_io_write_vma PARAMS ((FILE *ifp, bfd_vma val));
extern int gmon_io_write_32 PARAMS ((FILE *ifp, unsigned int val));
extern int gmon_io_write_8 PARAMS ((FILE *ifp, unsigned char val));
extern int gmon_io_write PARAMS ((FILE *ifp, char *buf, size_t n));
extern void gmon_out_read PARAMS ((const char *));
extern void gmon_out_write PARAMS ((const char *));

View File

@ -1,6 +1,6 @@
/* gmon_out.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -18,17 +18,14 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file specifies the format of gmon.out files. It should have
as few external dependencies as possible as it is going to be
included in many different programs. That is, minimize the
number of #include's.
A gmon.out file consists of a header (defined by gmon_hdr) followed
/* A gmon.out file consists of a header (defined by gmon_hdr) followed
by a sequence of records. Each record starts with a one-byte tag
identifying the type of records, followed by records specific data. */
#ifndef gmon_out_h
#define gmon_out_h
#include <gconfig.h>
#define GMON_MAGIC "gmon" /* magic cookie */
#define GMON_VERSION 1 /* version number */
@ -47,21 +44,4 @@ typedef enum
}
GMON_Record_Tag;
struct gmon_hist_hdr
{
char low_pc[sizeof (char*)]; /* Base pc address of sample buffer. */
char high_pc[sizeof (char*)]; /* Max pc address of sampled buffer. */
char hist_size[4]; /* Size of sample buffer. */
char prof_rate[4]; /* Profiling clock rate. */
char dimen[15]; /* Phys. dim., usually "seconds". */
char dimen_abbrev; /* Usually 's' for "seconds". */
};
struct gmon_cg_arc_record
{
char from_pc[sizeof (char*)]; /* Address within caller's body. */
char self_pc[sizeof (char*)]; /* Address within callee's body. */
char count[4]; /* Number of arc traversals. */
};
#endif /* gmon_out_h */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1983, 1998 Regents of the University of California.
* Copyright (c) 1983, 1998, 2001 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -429,18 +429,18 @@ This program is free software. This program has absolutely no warranty.\n"));
if (optarg != NULL)
{
enum demangling_styles style;
style = cplus_demangle_name_to_style (optarg);
if (style == unknown_demangling)
if (style == unknown_demangling)
{
fprintf (stderr,
_("%s: unknown demangling style `%s'\n"),
whoami, optarg);
xexit (1);
}
cplus_demangle_set_style (style);
}
}
break;
case OPTION_NO_DEMANGLE:
demangle = FALSE;

View File

@ -1,5 +1,7 @@
\input texinfo @c -*-texinfo-*-
@setfilename gprof.info
@c Copyright 1988, 1992, 1993, 1998, 1999, 2000, 2001
@c Free Software Foundation, Inc.
@settitle GNU gprof
@setchapternewpage odd

View File

@ -1,6 +1,6 @@
/* hist.c - Histogram related operations.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -43,11 +43,10 @@ bfd_vma lowpc, highpc; /* Same, but expressed in UNITs. */
int hist_num_bins = 0; /* Number of histogram samples. */
int *hist_sample = 0; /* Histogram samples (shorts in the file!). */
double hist_scale;
char hist_dimension[sizeof (((struct gmon_hist_hdr *) 0)->dimen) + 1] =
"seconds";
char hist_dimension[16] = "seconds";
char hist_dimension_abbrev = 's';
static double accum_time; /* Accumulated time so far for print_line(). */
static double accum_time; /* Accumulated time so far for print_line(). */
static double total_time; /* Total time for all routines. */
/* Table of SI prefixes for powers of 10 (used to automatically
@ -59,50 +58,17 @@ const struct
}
SItab[] =
{
{
'T', 1e-12
}
, /* tera */
{
'G', 1e-09
}
, /* giga */
{
'M', 1e-06
}
, /* mega */
{
'K', 1e-03
}
, /* kilo */
{
' ', 1e-00
}
,
{
'm', 1e+03
}
, /* milli */
{
'u', 1e+06
}
, /* micro */
{
'n', 1e+09
}
, /* nano */
{
'p', 1e+12
}
, /* pico */
{
'f', 1e+15
}
, /* femto */
{
'a', 1e+18
}
, /* ato */
{ 'T', 1e-12 }, /* tera */
{ 'G', 1e-09 }, /* giga */
{ 'M', 1e-06 }, /* mega */
{ 'K', 1e-03 }, /* kilo */
{ ' ', 1e-00 },
{ 'm', 1e+03 }, /* milli */
{ 'u', 1e+06 }, /* micro */
{ 'n', 1e+09 }, /* nano */
{ 'p', 1e+12 }, /* pico */
{ 'f', 1e+15 }, /* femto */
{ 'a', 1e+18 } /* ato */
};
@ -112,26 +78,23 @@ SItab[] =
void
DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
{
struct gmon_hist_hdr hdr;
bfd_vma n_lowpc, n_highpc;
int i, ncnt, profrate;
UNIT count;
if (fread (&hdr, sizeof (hdr), 1, ifp) != 1)
if (gmon_io_read_vma (ifp, &n_lowpc)
|| gmon_io_read_vma (ifp, &n_highpc)
|| gmon_io_read_32 (ifp, &ncnt)
|| gmon_io_read_32 (ifp, &profrate)
|| gmon_io_read (ifp, hist_dimension, 15)
|| gmon_io_read (ifp, &hist_dimension_abbrev, 1))
{
fprintf (stderr, _("%s: %s: unexpected end of file\n"),
whoami, filename);
done (1);
}
n_lowpc = (bfd_vma) get_vma (core_bfd, (bfd_byte *) hdr.low_pc);
n_highpc = (bfd_vma) get_vma (core_bfd, (bfd_byte *) hdr.high_pc);
ncnt = bfd_get_32 (core_bfd, (bfd_byte *) hdr.hist_size);
profrate = bfd_get_32 (core_bfd, (bfd_byte *) hdr.prof_rate);
strncpy (hist_dimension, hdr.dimen, sizeof (hdr.dimen));
hist_dimension[sizeof (hdr.dimen)] = '\0';
hist_dimension_abbrev = hdr.dimen_abbrev;
if (!s_highpc)
{
/* This is the first histogram record. */
@ -171,11 +134,15 @@ DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
if (fread (&count[0], sizeof (count), 1, ifp) != 1)
{
fprintf (stderr,
_("%s: %s: unexpected EOF after reading %d of %d samples\n"),
_("%s: %s: unexpected EOF after reading %d of %d samples\n"),
whoami, filename, i, hist_num_bins);
done (1);
}
hist_sample[i] += bfd_get_16 (core_bfd, (bfd_byte *) & count[0]);
DBG (SAMPLEDEBUG,
printf ("[hist_read_rec] 0x%lx: %u\n",
(unsigned long) (n_lowpc + i * (n_highpc - n_lowpc) / ncnt),
hist_sample[i]));
}
}
@ -186,23 +153,18 @@ DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
void
DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename)
{
struct gmon_hist_hdr hdr;
unsigned char tag;
UNIT count;
int i;
/* Write header. */
tag = GMON_TAG_TIME_HIST;
put_vma (core_bfd, s_lowpc, (bfd_byte *) hdr.low_pc);
put_vma (core_bfd, s_highpc, (bfd_byte *) hdr.high_pc);
bfd_put_32 (core_bfd, hist_num_bins, (bfd_byte *) hdr.hist_size);
bfd_put_32 (core_bfd, hz, (bfd_byte *) hdr.prof_rate);
strncpy (hdr.dimen, hist_dimension, sizeof (hdr.dimen));
hdr.dimen_abbrev = hist_dimension_abbrev;
if (fwrite (&tag, sizeof (tag), 1, ofp) != 1
|| fwrite (&hdr, sizeof (hdr), 1, ofp) != 1)
if (gmon_io_write_8 (ofp, GMON_TAG_TIME_HIST)
|| gmon_io_write_vma (ofp, s_lowpc)
|| gmon_io_write_vma (ofp, s_highpc)
|| gmon_io_write_32 (ofp, hist_num_bins)
|| gmon_io_write_32 (ofp, hz)
|| gmon_io_write (ofp, hist_dimension, 15)
|| gmon_io_write (ofp, &hist_dimension_abbrev, 1))
{
perror (filename);
done (1);
@ -211,7 +173,7 @@ DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename)
for (i = 0; i < hist_num_bins; ++i)
{
bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) & count[0]);
if (fwrite (&count[0], sizeof (count), 1, ofp) != 1)
{
perror (filename);
@ -239,7 +201,8 @@ scale_and_align_entries ()
{
sym->hist.scaled_addr = sym->addr / sizeof (UNIT);
bin_of_entry = (sym->hist.scaled_addr - lowpc) / hist_scale;
bin_of_code = (sym->hist.scaled_addr + UNITS_TO_CODE - lowpc) / hist_scale;
bin_of_code = ((sym->hist.scaled_addr + UNITS_TO_CODE - lowpc)
/ hist_scale);
if (bin_of_entry < bin_of_code)
{
DBG (SAMPLEDEBUG,
@ -254,33 +217,33 @@ scale_and_align_entries ()
/* Assign samples to the symbol to which they belong.
Histogram bin I covers some address range [BIN_LOWPC,BIN_HIGH_PC)
which may overlap one more symbol address ranges. If a symbol
overlaps with the bin's address range by O percent, then O percent
of the bin's count is credited to that symbol.
There are three cases as to where BIN_LOW_PC and BIN_HIGH_PC can be
with respect to the symbol's address range [SYM_LOW_PC,
SYM_HIGH_PC) as shown in the following diagram. OVERLAP computes
the distance (in UNITs) between the arrows, the fraction of the
sample that is to be credited to the symbol which starts at
SYM_LOW_PC.
sym_low_pc sym_high_pc
| |
v v
+-----------------------------------------------+
| |
| ->| |<- ->| |<- ->| |<- |
| | | | | |
+---------+ +---------+ +---------+
^ ^ ^ ^ ^ ^
| | | | | |
sym_low_pc sym_high_pc
| |
v v
+-----------------------------------------------+
| |
| ->| |<- ->| |<- ->| |<- |
| | | | | |
+---------+ +---------+ +---------+
^ ^ ^ ^ ^ ^
| | | | | |
bin_low_pc bin_high_pc bin_low_pc bin_high_pc bin_low_pc bin_high_pc
For the VAX we assert that samples will never fall in the first two
bytes of any routine, since that is the entry mask, thus we call
scale_and_align_entries() to adjust the entry points if the entry
@ -315,7 +278,7 @@ DEFUN_VOID (hist_assign_samples)
bin_low_pc = lowpc + (bfd_vma) (hist_scale * i);
bin_high_pc = lowpc + (bfd_vma) (hist_scale * (i + 1));
time = bin_count;
DBG (SAMPLEDEBUG,
printf (
"[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%d\n",
@ -329,7 +292,7 @@ DEFUN_VOID (hist_assign_samples)
{
sym_low_pc = symtab.base[j].hist.scaled_addr;
sym_high_pc = symtab.base[j + 1].hist.scaled_addr;
/* If high end of bin is below entry address,
go for next bin. */
if (bin_high_pc < sym_low_pc)
@ -346,18 +309,18 @@ DEFUN_VOID (hist_assign_samples)
{
DBG (SAMPLEDEBUG,
printf (
"[assign_samples] [0x%lx,0x%lx) %s gets %f ticks %ld overlap\n",
(unsigned long) symtab.base[j].addr,
(unsigned long) (sizeof (UNIT) * sym_high_pc),
symtab.base[j].name, overlap * time / hist_scale,
(long) overlap));
"[assign_samples] [0x%lx,0x%lx) %s gets %f ticks %ld overlap\n",
(unsigned long) symtab.base[j].addr,
(unsigned long) (sizeof (UNIT) * sym_high_pc),
symtab.base[j].name, overlap * time / hist_scale,
(long) overlap));
addr = symtab.base[j].addr;
credit = overlap * time / hist_scale;
/* Credit symbol if it appears in INCL_FLAT or that
table is empty and it does not appear it in
EXCL_FLAT. */
table is empty and it does not appear it in
EXCL_FLAT. */
if (sym_lookup (&syms[INCL_FLAT], addr)
|| (syms[INCL_FLAT].len == 0
&& !sym_lookup (&syms[EXCL_FLAT], addr)))
@ -371,7 +334,7 @@ DEFUN_VOID (hist_assign_samples)
}
}
}
DBG (SAMPLEDEBUG, printf ("[assign_samples] total_time %f\n",
total_time));
}
@ -404,13 +367,14 @@ DEFUN (print_header, (prefix), const char prefix)
if (total_time <= 0.0)
{
printf (_(" no time accumulated\n\n"));
/* This doesn't hurt since all the numerators will be zero. */
total_time = 1.0;
}
printf ("%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n",
"% ", _("cumulative"), _("self "), "", _("self "), _("total "), "");
"% ", _("cumulative"), _("self "), "", _("self "), _("total "),
"");
printf ("%5.5s %9.9s %8.8s %8.8s %8.8s %8.8s %-8.8s\n",
_("time"), hist_dimension, hist_dimension, _("calls"), unit, unit,
_("name"));
@ -424,7 +388,7 @@ DEFUN (print_line, (sym, scale), Sym * sym AND double scale)
return;
accum_time += sym->hist.time;
if (bsd_style_output)
printf ("%5.1f %10.2f %8.2f",
total_time > 0.0 ? 100 * sym->hist.time / total_time : 0.0,
@ -433,14 +397,14 @@ DEFUN (print_line, (sym, scale), Sym * sym AND double scale)
printf ("%6.2f %9.2f %8.2f",
total_time > 0.0 ? 100 * sym->hist.time / total_time : 0.0,
accum_time / hz, sym->hist.time / hz);
if (sym->ncalls != 0)
printf (" %8lu %8.2f %8.2f ",
sym->ncalls, scale * sym->hist.time / hz / sym->ncalls,
scale * (sym->hist.time + sym->cg.child_time) / hz / sym->ncalls);
else
printf (" %8.8s %8.8s %8.8s ", "", "", "");
if (bsd_style_output)
print_name (sym);
else
@ -462,10 +426,10 @@ DEFUN (cmp_time, (lp, rp), const PTR lp AND const PTR rp)
double time_diff;
time_diff = right->hist.time - left->hist.time;
if (time_diff > 0.0)
return 1;
if (time_diff < 0.0)
return -1;
@ -496,7 +460,7 @@ DEFUN_VOID (hist_print)
printf ("\f\n");
accum_time = 0.0;
if (bsd_style_output)
{
if (print_descriptions)
@ -509,11 +473,11 @@ DEFUN_VOID (hist_print)
{
printf (_("Flat profile:\n"));
}
/* Sort the symbol table by time (call-count and name as secondary
and tertiary keys). */
time_sorted_syms = (Sym **) xmalloc (symtab.len * sizeof (Sym *));
for (index = 0; index < symtab.len; ++index)
time_sorted_syms[index] = &symtab.base[index];
@ -530,15 +494,15 @@ DEFUN_VOID (hist_print)
log_scale = 0;
top_dog = 0;
top_time = 0.0;
for (index = 0; index < symtab.len; ++index)
{
sym = time_sorted_syms[index];
if (sym->ncalls != 0)
{
time = (sym->hist.time + sym->cg.child_time) / sym->ncalls;
if (time > top_time)
{
top_dog = sym;
@ -546,11 +510,11 @@ DEFUN_VOID (hist_print)
}
}
}
if (top_dog && top_dog->ncalls != 0 && top_time > 0.0)
{
top_time /= hz;
while (SItab[log_scale].scale * top_time < 1000.0
&& ((size_t) log_scale
< sizeof (SItab) / sizeof (SItab[0]) - 1))
@ -564,19 +528,19 @@ DEFUN_VOID (hist_print)
may also want to support other (pseudo-)dimensions (such as
I-cache misses etc.). */
print_header (SItab[log_scale].prefix);
for (index = 0; index < symtab.len; ++index)
{
addr = time_sorted_syms[index]->addr;
/* Print symbol if its in INCL_FLAT table or that table
is empty and the symbol is not in EXCL_FLAT. */
is empty and the symbol is not in EXCL_FLAT. */
if (sym_lookup (&syms[INCL_FLAT], addr)
|| (syms[INCL_FLAT].len == 0
&& !sym_lookup (&syms[EXCL_FLAT], addr)))
print_line (time_sorted_syms[index], SItab[log_scale].scale);
}
free (time_sorted_syms);
if (print_descriptions && !bsd_style_output)

View File

@ -1,6 +1,6 @@
/* hist.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1983 Regents of the University of California.
* Copyright (c) 1983, 2001 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -71,7 +71,7 @@ i386_find_call (parent, p_lowpc, p_highpc)
(unsigned long) (instructp - (unsigned char *) delta)));
/*
* regular pc relative addressing
* check that this is the address of
* check that this is the address of
* a function.
*/

View File

@ -1,6 +1,6 @@
/* search-list.c
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -37,7 +37,7 @@ DEFUN (search_list_append, (list, paths),
{
beg = colon + 1;
colon = strchr (beg, PATH_SEP_CHAR);
if (colon)
len = colon - beg;
else
@ -49,7 +49,7 @@ DEFUN (search_list_append, (list, paths),
/* Append new path at end of list. */
new_el->next = 0;
if (list->tail)
list->tail->next = new_el;
else

View File

@ -1,6 +1,6 @@
/* search-list.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -1,6 +1,6 @@
/* source.c - Keep track of source files.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -44,19 +44,19 @@ DEFUN (source_file_lookup_path, (path), const char *path)
if (FILENAME_CMP (path, sf->name) == 0)
break;
}
if (!sf)
{
/* Create a new source file descriptor. */
sf = (Source_File *) xmalloc (sizeof (*sf));
memset (sf, 0, sizeof (*sf));
sf->name = xstrdup (path);
sf->next = first_src_file;
first_src_file = sf;
}
return sf;
}
@ -66,7 +66,7 @@ DEFUN (source_file_lookup_name, (filename), const char *filename)
{
const char *fname;
Source_File *sf;
/* The user cannot know exactly how a filename will be stored in
the debugging info (e.g., ../include/foo.h
vs. /usr/include/foo.h). So we simply compare the filename
@ -74,7 +74,7 @@ DEFUN (source_file_lookup_name, (filename), const char *filename)
for (sf = first_src_file; sf; sf = sf->next)
{
fname = strrchr (sf->name, '/');
if (fname)
++fname;
else
@ -83,7 +83,7 @@ DEFUN (source_file_lookup_name, (filename), const char *filename)
if (FILENAME_CMP (filename, fname) == 0)
break;
}
return sf;
}
@ -106,7 +106,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
/* Open input file. If open fails, walk along search-list until
open succeeds or reaching end of list. */
strcpy (fname, sf->name);
if (IS_ABSOLUTE_PATH (sf->name))
sle = 0; /* Don't use search list for absolute paths. */
@ -115,7 +115,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
{
DBG (SRCDEBUG, printf ("[annotate_source]: looking for %s, trying %s\n",
sf->name, fname));
ifp = fopen (fname, FOPEN_RB);
if (ifp)
break;
@ -139,7 +139,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
sle = src_search_list.head;
}
}
if (sle)
{
strcpy (fname, sle->path);
@ -149,7 +149,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
strcat (fname, ".");
#endif
strcat (fname, "/");
if (name_only)
strcat (fname, name_only);
else
@ -170,7 +170,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
}
ofp = stdout;
if (create_annotation_files)
{
/* Try to create annotated source file. */
@ -213,7 +213,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
}
#endif
ofp = fopen (fname, "w");
if (!ofp)
{
perror (fname);
@ -241,7 +241,7 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
annotation = xmalloc (max_width + 1);
line_num = 1;
new_line = TRUE;
while ((nread = fread (buf, 1, sizeof (buf), ifp)) > 0)
{
for (i = 0; i < nread; ++i)
@ -253,12 +253,12 @@ DEFUN (annotate_source, (sf, max_width, annote, arg),
++line_num;
new_line = FALSE;
}
new_line = (buf[i] == '\n');
fputc (buf[i], ofp);
}
}
free (annotation);
return ofp;
}

View File

@ -1,6 +1,6 @@
/* source.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -53,7 +53,7 @@ extern Source_File *source_file_lookup_name PARAMS ((const char *));
MAX_WIDTH characters wide and for each source-line an annotation is
obtained by invoking function ANNOTE. ARG is an argument passed to
ANNOTE that is left uninterpreted by annotate_source().
Returns a pointer to the output file (which maybe stdout) such
that summary statistics can be printed. If the returned file
is not stdout, it should be closed when done with it. */

View File

@ -1,6 +1,6 @@
/* sym_ids.c
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -31,7 +31,7 @@ struct sym_id
char *spec; /* Parsing modifies this. */
Table_Id which_table;
bool has_right;
struct match
{
int prev_index; /* Index of prev match. */
@ -91,11 +91,11 @@ DEFUN (sym_id_add, (spec, which_table),
/* A spec has the syntax FILENAME:(FUNCNAME|LINENUM). As a convenience
to the user, a spec without a colon is interpreted as:
(i) a FILENAME if it contains a dot
(ii) a FUNCNAME if it starts with a non-digit character
(iii) a LINENUM if it starts with a digit
(i) a FILENAME if it contains a dot
(ii) a FUNCNAME if it starts with a non-digit character
(iii) a LINENUM if it starts with a digit
A FUNCNAME containing a dot can be specified by :FUNCNAME, a
FILENAME not containing a dot can be specified by FILENAME. */
@ -106,21 +106,21 @@ DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym)
sym_init (sym);
colon = strrchr (spec, ':');
if (colon)
{
*colon = '\0';
if (colon > spec)
{
sym->file = source_file_lookup_name (spec);
if (!sym->file)
sym->file = &non_existent_file;
}
spec = colon + 1;
if (strlen (spec))
{
if (isdigit ((unsigned char) spec[0]))
@ -135,7 +135,7 @@ DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym)
if (strchr (spec, '.'))
{
sym->file = source_file_lookup_name (spec);
if (!sym->file)
sym->file = &non_existent_file;
}
@ -174,19 +174,19 @@ DEFUN (parse_id, (id), struct sym_id *id)
if (debug_level & IDDEBUG)
{
printf ("%s:", id->left.sym.file ? id->left.sym.file->name : "*");
if (id->left.sym.name)
printf ("%s", id->left.sym.name);
else if (id->left.sym.line_num)
printf ("%d", id->left.sym.line_num);
else
printf ("*");
if (id->has_right)
{
printf ("/%s:",
id->right.sym.file ? id->right.sym.file->name : "*");
if (id->right.sym.name)
printf ("%s", id->right.sym.name);
else if (id->right.sym.line_num)
@ -194,7 +194,7 @@ DEFUN (parse_id, (id), struct sym_id *id)
else
printf ("*");
}
printf ("\n");
}
#endif
@ -231,7 +231,7 @@ DEFUN (extend_match, (m, sym, tab, second_pass),
tab->base[tab->len].next = m->first_match;
m->first_match = &tab->base[tab->len];
}
++tab->len;
}
@ -246,7 +246,7 @@ DEFUN (extend_match, (m, sym, tab, second_pass),
/* Go through sym_id list produced by option processing and fill
in the various symbol tables indicating what symbols should
be displayed or suppressed for the various kinds of outputs.
This can potentially produce huge tables and in particulars
tons of arcs, but this happens only if the user makes silly
requests---you get what you ask for! */
@ -285,7 +285,7 @@ DEFUN_VOID (sym_id_parse)
tab->len = 0;
}
}
if (right_ids.len)
{
right_ids.base = (Sym *) xmalloc (right_ids.len * sizeof (Sym));
@ -327,7 +327,7 @@ DEFUN_VOID (sym_id_parse)
(unsigned long) right->addr,
(unsigned long) right->end_addr,
table_name[id->which_table]));
arc_add (left, right, (unsigned long) 0);
}
}
@ -362,6 +362,6 @@ DEFUN (sym_id_arc_is_present, (symtab, from, to),
&& arc_lookup (sym, to))
return TRUE;
}
return FALSE;
}

View File

@ -1,6 +1,6 @@
/* sym_ids.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -1,6 +1,6 @@
/* symtab.c
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -33,7 +33,7 @@ void
DEFUN (sym_init, (sym), Sym * sym)
{
memset (sym, 0, sizeof (*sym));
/* It is not safe to assume that a binary zero corresponds
to a floating-point 0.0, so initialize floats explicitly. */
sym->hist.time = 0.0;
@ -86,7 +86,7 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab)
/* Remove duplicate entries to speed-up later processing and
set end_addr if its not set yet. */
prev_addr = tab->base[0].addr + 1;
for (src = dst = tab->base; src < tab->limit; ++src)
{
if (src->addr == prev_addr)
@ -114,7 +114,7 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab)
dst[-1].name, dst[-1].is_static ? 't' : 'T',
dst[-1].is_func ? 'F' : 'f');
printf (" (addr=%lx)\n", (unsigned long) src->addr));
dst[-1] = *src;
}
else
@ -142,7 +142,7 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab)
}
}
}
if (tab->len > 0 && dst[-1].end_addr == 0)
dst[-1].end_addr = core_text_sect->vma + core_text_sect->_raw_size - 1;
@ -157,11 +157,11 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab)
unsigned int j;
for (j = 0; j < tab->len; ++j)
{
{
printf ("[symtab_finalize] 0x%lx-0x%lx\t%s\n",
(long) tab->base[j].addr, (long) tab->base[j].end_addr,
tab->base[j].name);
}
}
);
}
@ -181,13 +181,13 @@ DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address
for (low = 0, high = symtab->len - 1; low != high;)
{
mid = (high + low) >> 1;
fprintf (stderr, "[dbg_sym_lookup] low=0x%lx, mid=0x%lx, high=0x%lx\n",
low, mid, high);
fprintf (stderr, "[dbg_sym_lookup] sym[m]=0x%lx sym[m + 1]=0x%lx\n",
(unsigned long) sym[mid].addr,
(unsigned long) sym[mid + 1].addr);
if (sym[mid].addr <= address && sym[mid + 1].addr > address)
return &sym[mid];
@ -196,9 +196,9 @@ DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address
else
low = mid + 1;
}
fprintf (stderr, "[dbg_sym_lookup] binary search fails???\n");
return 0;
}
@ -225,7 +225,7 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
{
DBG (LOOKUPDEBUG, ++probes);
mid = (high + low) / 2;
if (sym[mid].addr <= address && sym[mid + 1].addr > address)
{
if (address > sym[mid].end_addr)
@ -242,13 +242,13 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
return &sym[mid];
}
}
if (sym[mid].addr > address)
high = mid;
else
low = mid + 1;
}
if (sym[mid + 1].addr <= address)
{
if (address > sym[mid + 1].end_addr)
@ -263,6 +263,6 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
return &sym[mid + 1];
}
}
return 0;
}

View File

@ -1,6 +1,6 @@
/* symtab.h
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
to map code-addresses into source-code information. Source-code
information can be any combination of: (i) function-name, (ii)
source file-name, and (iii) source line number.
The symbol table is used to map addresses into source-code
information. */
@ -41,11 +41,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
typedef struct sym
{
/* Common information:
In the symbol-table, fields ADDR and FUNC_NAME are guaranteed
to contain valid information. FILE may be 0, if unknown and
LINE_NUM maybe 0 if unknown. */
bfd_vma addr; /* Address of entry point. */
bfd_vma end_addr; /* End-address. */
const char *name; /* Name of function this sym is from. */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1983 Regents of the University of California.
* Copyright (c) 1983, 2001 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -304,7 +304,7 @@ tahoe_find_call (parent, p_lowpc, p_highpc)
case longrel:
/*
* regular pc relative addressing
* check that this is the address of
* check that this is the address of
* a function.
*/
destpc = tahoe_reladdr (instructp + length)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1983, 1998 Regents of the University of California.
* Copyright (c) 1983, 1998, 2001 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -68,7 +68,8 @@ DEFUN (print_name_only, (self), Sym * self)
filename = self->file->name;
}
}
sprintf (buf, " (%s:%d)", filename, self->line_num);
sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num,
(unsigned long) self->addr);
printf ("%s", buf);
size += strlen (buf);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1983 Regents of the University of California.
* Copyright (c) 1983, 2001 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
@ -307,7 +307,7 @@ vax_find_call (parent, p_lowpc, p_highpc)
case longrel:
/*
* regular pc relative addressing
* check that this is the address of
* check that this is the address of
* a function.
*/
destpc = vax_reladdr ((struct modebyte *) (instructp + length))

View File

@ -1,3 +1,126 @@
2001-06-07 Andreas Jaeger <aj@suse.de>
* elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase.
(TEXT_START_ADDR): Likewise.
2001-06-11 Alan Modra <amodra@bigpond.net.au>
Merge from mainline.
2001-06-05 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
* emultempl/pe.em (init): Reduce default stack reserve to 0x200000.
2001-05-25 Alan Modra <amodra@one.net.au>
* configure.host: Replace linuxoldld with linux*oldld.
* configure.tgt: Likewise.
2001-05-14 DJ Delorie <dj@delorie.com>
* Makefile.am (ld.dvi): Search bfd/doc for texinfo files.
* Makefile.in: Ditto.
2001-04-05 Steven J. Hill <sjhill@cotw.com>
* Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o.
(ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o.
(eelf32ltsmip.c): New target.
(eelf64btsmip.c): Likewise.
(eelf64ltsmip.c): Likewise.
* Makefile.in: Regenerated.
* configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS
target.
(mips*-*-linux-gnu*): Likewise.
* emulparams/elf32ltsmip.sh: New. Traditional little endian
MIPS taget.
* emulparams/elf64btsmip.sh: New. Traditional 64bit big endian
target.
* emulparams/elf64ltsmip.sh: New. Traditional 64bit little
endian target.
2001-02-27 Alan Modra <alan@linuxcare.com.au>
* configure.in (BFD_VERSION): New.
(AM_INIT_AUTOMAKE): Use $BFD_VERSION.
* configure: Regenerate.
2001-02-13 H.J. Lu <hjl@gnu.org>
* ldexp.h (node_type): Add etree_provided.
* ldexp.c (exp_fold_tree): Handle etree_provided. Set the node
type to etree_provided if defined by PROVIDE. Allow updating
for etree_provided.
(exp_print_tree): Handle etree_provided.
* mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle
etree_provided.
2001-06-10 Philip Blundell <philb@gnu.org>
* configure.in: Set version to 2.11.1.
* configure: Regenerate.
2001-06-08 Alan Modra <amodra@bigpond.net.au>
* ldlang.c (record_bfd_errors): Remove.
Merge from mainline.
2001-05-31 H.J. Lu <hjl@gnu.org>
* ldlang.c (open_input_bfds): Don't change the bfd error
handler whilst loading symbols.
2001-05-02 Nick Clifton <nickc@redhat.com>
* emultempl/aix.em: Replace buystring with xstrdup.
* emultempl/beos.em: Replace buystring with xstrdup.
2001-06-07 Alan Modra <amodra@bigpond.net.au>
* Many files: Update copyright notices.
2001-05-23 Alan Modra <amodra@one.net.au>
* ldlang.c (wild_doit): Use linker_has_input to reliably determine
whether an input section is the first one assigned to an output
section.
Assorted formatting fixes.
Merge from mainline.
2001-05-03 H.J. Lu <hjl@gnu.org>
* emultempl/elf32.em: Include "libiberty.h".
(gld${EMULATION_NAME}_vercheck): Call basename () to get the
basename of the bfd filename.
(gld${EMULATION_NAME}_stat_needed): Likewise.
(gld${EMULATION_NAME}_try_needed): Likewise.
(gld${EMULATION_NAME}_open_dynamic_archive): Likewise.
2001-03-17 Ulrich Drepper <drepper@redhat.com>
* emultmpl/elf32.em (OPTION_GROUP): New macro.
Add new option Bgroup to longopts.
(gld*_parse_args): Handle GROUP_OPTION and recognize -z defs.
(gld*_list_options): Add -Bgroup and -z defs.
* ld.1: Document -Bgroup and -z defs.
* ld.texinfo: Likewise.
2001-02-01 Nick Clifton <nickc@redhat.com>
* ld.1: Replace occurances of -oformat with --oformat.
2001-05-02 H.J. Lu <hjl@gnu.org>
* ldfile.c: Include "libiberty.h".
* ldlex.l: Likewise.
* ldmisc.c (buystring): Removed.
* ldmisc.h: Likewise.
* ldfile.c: Replace buystring with xstrdup.
* ldlang.c: Likewise.
* ldlex.l: Likewise.
* ldmain.c: Likewise.
* ldmisc.c: Likewise.
* lexsup.c: Likewise.
* mpw-eppcmac.c: Likewise.
2001-04-28 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
* ldlang.c (load_symbols): Give emulation a chance
to process unrecognized file before fatal error is
reported, not after.
2001-02-26 H.J. Lu <hjl@gnu.org>
* ldlang.c (open_input_bfds): Set the bfd error handler so
that problems can be caught whilst loading symbols.
(record_bfd_errors): New function: Report BFD errors and mark
the executable output as being invalid.
2001-04-02 Alan Modra <alan@linuxcare.com.au>
* emulparams/hppalinux.sh (MAXPAGESIZE): Set to 64k.
@ -670,7 +793,7 @@ Tue Nov 14 00:59:19 2000 Denis Chertykov <denisc@overta.ru>
* scripttempl/elf.sc: Add .gnu.linkonce.wi.* to .debug_info
sections.
* scripttempl/elf32var.sc: Ditto.
* scripttempl/elf32avr.sc: Ditto.
* scripttempl/elfd10v.sc: Ditto.
* scripttempl/elfd30v.sc: Ditto.
* scripttempl/elfi370.sc: Ditto.
@ -867,8 +990,8 @@ Tue Nov 14 00:59:19 2000 Denis Chertykov <denisc@overta.ru>
2000-07-05 Kenneth Block <krblock@computer.org>
* ld/lexsup.c: Add optional style to demangle switch
* ld/ld.texinfo: Document optional style to demangle switch.
* lexsup.c: Add optional style to demangle switch
* ld.texinfo: Document optional style to demangle switch.
2000-07-20 Hans-Peter Nilsson <hp@axis.com>
@ -924,7 +1047,7 @@ Tue Nov 14 00:59:19 2000 Denis Chertykov <denisc@overta.ru>
2000-07-16 Charles Wilson <cwilson@ece.gatech.edu>
* src/ld/emultempl/pe.em (gld_*_open_dynamic_archive): New search
* emultempl/pe.em (gld_*_open_dynamic_archive): New search
order for dynamic library '-lfoo' on pei386: libfoo.dll.a,
foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility
errors introduced by the old dynamic lib search order.
@ -1256,7 +1379,7 @@ Thu May 18 10:47:57 2000 Jeffrey A Law (law@cygnus.com)
2000-05-16 Charles Wilson <cwilson@ece.gatech.edu>
* ld/emultempl/pe.em (_open_dynamic_archive): New function: Search
* emultempl/pe.em (_open_dynamic_archive): New function: Search
the library path for "foo.dll" and "libfoo.dll" dynamic libraries
before searching for 'libfoo.a' in response to a '-Bdynamic -lfoo'
link options.
@ -1563,7 +1686,7 @@ Fri Apr 7 15:56:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
(gld_X_find_potential_libraries): New function. Search for
libraries called "*.lib".
* scriptempl/pe.sc: Add .pdata section.
* scripttempl/pe.sc: Add .pdata section.
2000-02-23 Richard Henderson <rth@cygnus.com>
@ -1624,9 +1747,9 @@ Fri Apr 7 15:56:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-02-03 Timothy Wall <twall@redhat.com>
* ld/ldexp.c (fold_name): Make SIZEOF operator return byte count, not
* ldexp.c (fold_name): Make SIZEOF operator return byte count, not
octet count.
* ld/ldlang.c (print_input_section, print_data_statement,
* ldlang.c (print_input_section, print_data_statement,
print_reloc_statement, print_padding_statement): Print target
address values and section sizes as bytes, not octets.
(insert_pad) Calculate padding size in octets, and adjust "dot"

View File

@ -6,7 +6,10 @@ AC_INIT(ldmain.c)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
AM_INIT_AUTOMAKE(ld, 2.11)
changequote(,)dnl
BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
changequote([,])dnl
AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})
AM_PROG_LIBTOOL

View File

@ -1,5 +1,5 @@
/* deffile.h - header for .DEF file parser
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Written by DJ Delorie dj@cygnus.com
This file is part of GLD, the Gnu Linker.

View File

@ -1,6 +1,6 @@
%{ /* deffilep.y - parser for .def files */
/* Copyright (C) 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
/* Copyright 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Binutils.

View File

@ -0,0 +1,31 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-tradlittlemips"
BIG_OUTPUT_FORMAT="elf32-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips"
TEXT_START_ADDR=0x0400000
DATA_ADDR=0x10000000
MAXPAGESIZE=0x40000
NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x0
TEXT_DYNAMIC=
INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
ARCH=mips
MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
ENTRY=__start

View File

@ -0,0 +1,44 @@
# This is an ELF platform.
SCRIPT_NAME=elf
# Handle both big- and little-ended 64-bit MIPS objects.
ARCH=mips
OUTPUT_FORMAT="elf64-tradbigmips"
BIG_OUTPUT_FORMAT="elf64-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
# Note that the elf32 template is used for 64-bit emulations as well
# as 32-bit emulations.
ELFSIZE=64
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
TEXT_START_ADDR=0x10000000
DATA_ADDR=0x0400000000
MAXPAGESIZE=0x100000
NONPAGED_TEXT_START_ADDR=0x10000000
SHLIB_TEXT_START_ADDR=0x0
TEXT_DYNAMIC=
ENTRY=__start
# GOT-related settings.
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
# Magic symbols.
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
# Magic sections.
INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'

View File

@ -0,0 +1,44 @@
# This is an ELF platform.
SCRIPT_NAME=elf
# Handle both big- and little-ended 64-bit MIPS objects.
ARCH=mips
OUTPUT_FORMAT="elf64-tradlittlemips"
BIG_OUTPUT_FORMAT="elf64-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
# Note that the elf32 template is used for 64-bit emulations as well
# as 32-bit emulations.
ELFSIZE=64
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
TEXT_START_ADDR=0x10000000
DATA_ADDR=0x0400000000
MAXPAGESIZE=0x100000
NONPAGED_TEXT_START_ADDR=0x10000000
SHLIB_TEXT_START_ADDR=0x0
TEXT_DYNAMIC=
ENTRY=__start
# GOT-related settings.
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
OTHER_GOT_SECTIONS='
.lit8 : { *(.lit8) }
.lit4 : { *(.lit4) }
'
# Magic symbols.
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
# Magic sections.
INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'

View File

@ -1,9 +1,9 @@
SCRIPT_NAME=elf
ELFSIZE=64
OUTPUT_FORMAT="elf64-x86-64"
TEXT_START_ADDR=0x1000
MAXPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x1000
TEXT_START_ADDR=0x400000
MAXPAGESIZE=0x100000
NONPAGED_TEXT_START_ADDR=0x400000
ARCH=i386
MACHINE=
NOP=0x9090

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* AIX emulation code for ${EMULATION_NAME}
Copyright (C) 1991, 93, 95, 96, 97, 98, 99, 2000
Copyright 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2001
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com>
@ -857,7 +857,7 @@ gld${EMULATION_NAME}_read_file (filename, import)
n = ((struct export_symbol_list *)
xmalloc (sizeof (struct export_symbol_list)));
n->next = export_symbols;
n->name = buystring (symname);
n->name = xstrdup (symname);
n->syscall = syscall;
export_symbols = n;
}

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
Copyright (C) 1991, 93, 96, 97, 98, 99, 2000
Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com

View File

@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
# Copyright (C) 1991, 93, 96, 97, 98, 99, 2000
# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
Copyright (C) 1991, 93, 96, 97, 98, 99, 2000
Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com

View File

@ -2,7 +2,7 @@
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
Copyright 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -739,7 +739,7 @@ gld${EMULATION_NAME}_place_orphan (file, s)
/* Look up the output section. The Microsoft specs say sections names in
image files never contain a '\$'. Fortunately, lang_..._lookup creates
the section if it doesn't exist. */
output_secname = buystring (secname);
output_secname = xstrdup (secname);
ps = strchr (output_secname + 1, '\$');
*ps = 0;
os = lang_output_section_statement_lookup (output_secname);

View File

@ -7,7 +7,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
Copyright (C) 1991, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libiberty.h"
#include <ctype.h>
@ -130,7 +131,7 @@ static void
gld${EMULATION_NAME}_vercheck (s)
lang_input_statement_type *s;
{
const char *soname, *f;
const char *soname;
struct bfd_link_needed_list *l;
if (global_vercheck_failed)
@ -141,19 +142,13 @@ gld${EMULATION_NAME}_vercheck (s)
soname = bfd_elf_get_dt_soname (s->the_bfd);
if (soname == NULL)
soname = bfd_get_filename (s->the_bfd);
f = strrchr (soname, '/');
if (f != NULL)
++f;
else
f = soname;
soname = basename (bfd_get_filename (s->the_bfd));
for (l = global_vercheck_needed; l != NULL; l = l->next)
{
const char *suffix;
if (strcmp (f, l->name) == 0)
if (strcmp (soname, l->name) == 0)
{
/* Probably can't happen, but it's an easy check. */
continue;
@ -168,7 +163,7 @@ gld${EMULATION_NAME}_vercheck (s)
suffix += sizeof ".so." - 1;
if (strncmp (f, l->name, suffix - l->name) == 0)
if (strncmp (soname, l->name, suffix - l->name) == 0)
{
/* Here we know that S is a dynamic object FOO.SO.VER1, and
the object we are considering needs a dynamic object
@ -192,7 +187,6 @@ gld${EMULATION_NAME}_stat_needed (s)
struct stat st;
const char *suffix;
const char *soname;
const char *f;
if (global_found)
return;
@ -230,17 +224,12 @@ gld${EMULATION_NAME}_stat_needed (s)
soname = bfd_elf_get_dt_soname (s->the_bfd);
if (soname == NULL)
soname = s->filename;
soname = basename (s->filename);
f = strrchr (soname, '/');
if (f != NULL)
++f;
else
f = soname;
if (strncmp (f, global_needed->name, suffix - global_needed->name) == 0)
if (strncmp (soname, global_needed->name,
suffix - global_needed->name) == 0)
einfo ("%P: warning: %s, needed by %B, may conflict with %s\n",
global_needed->name, global_needed->by, f);
global_needed->name, global_needed->by, soname);
}
@ -340,11 +329,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
einfo ("%F%P:%B: bfd_stat failed: %E\n", abfd);
/* First strip off everything before the last '/'. */
soname = strrchr (abfd->filename, '/');
if (soname)
soname++;
else
soname = abfd->filename;
soname = basename (abfd->filename);
if (trace_file_tries)
info_msg (_("found %s at %s\n"), soname, name);
@ -949,20 +934,13 @@ gld${EMULATION_NAME}_open_dynamic_archive (arch, search, entry)
if (bfd_check_format (entry->the_bfd, bfd_object)
&& (entry->the_bfd->flags & DYNAMIC) != 0)
{
char *needed_name;
ASSERT (entry->is_archive && entry->search_dirs_flag);
/* Rather than duplicating the logic above. Just use the
filename we recorded earlier.
filename we recorded earlier. */
First strip off everything before the last '/'. */
filename = strrchr (entry->filename, '/');
filename++;
needed_name = (char *) xmalloc (strlen (filename) + 1);
strcpy (needed_name, filename);
bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name);
filename = xstrdup (basename (entry->filename));
bfd_elf_set_dt_needed_name (entry->the_bfd, filename);
}
return true;
@ -1337,6 +1315,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
#define OPTION_DISABLE_NEW_DTAGS (400)
#define OPTION_ENABLE_NEW_DTAGS (OPTION_DISABLE_NEW_DTAGS + 1)
#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
static struct option longopts[] =
{
@ -1350,6 +1329,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
{"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
{"Bgroup", no_argument, NULL, OPTION_GROUP},
{"Bgroup", no_argument, NULL, OPTION_GROUP},
EOF
fi
@ -1408,6 +1389,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.new_dtags = true;
break;
case OPTION_GROUP:
link_info.flags_1 |= (bfd_vma) DF_1_GROUP;
/* Groups must be self-contained. */
link_info.no_undefined = true;
break;
case 'z':
if (strcmp (optarg, "initfirst") == 0)
link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST;
@ -1433,6 +1420,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.flags |= (bfd_vma) DF_ORIGIN;
link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN;
}
else if (strcmp (optarg, "defs") == 0)
link_info.no_undefined = true;
/* What about the other Solaris -z options? FIXME. */
break;
EOF
@ -1466,8 +1455,10 @@ EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" -Bgroup\t\tSelects group name lookup rules for DSO\n"));
fprintf (file, _(" --disable-new-dtags\tDisable new dynamic tags\n"));
fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n"));
fprintf (file, _(" -z defs\t\tDisallows undefined symbols\n"));
fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n"));
fprintf (file, _(" -z interpose\t\tMark object to interpose all DSOs but executable\n"));
fprintf (file, _(" -z loadfltr\t\tMark object requiring immediate process\n"));

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
Copyright (C) 1991, 93, 94, 95, 96, 99, 2000
Copyright 1991, 1992, 1994, 1996, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com

View File

@ -1,7 +1,7 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* Copyright (C) 1991, 93, 94, 95, 99, 2000 Free Software Foundation, Inc.
/* Copyright 1991, 1992, 1994, 1999, 2000 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,7 +1,7 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* Copyright (C) 1991, 93, 94, 95, 96, 99, 2000
/* Copyright 1991, 1993, 1994, 1996, 1999, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
# Copyright 1991, 93, 94, 95, 97, 99, 2000, 2001
# Copyright 1991, 1993, 1994, 1997, 1999, 2000, 2001
# Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Linux a.out emulation code for ${EMULATION_NAME}
Copyright (C) 1991, 93, 94, 95, 96, 98, 99, 2000
Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com>

View File

@ -2,7 +2,7 @@
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* intel coff loader emulation specific stuff
Copyright (C) 1991, 93, 94, 95, 96, 99, 2000
Copyright 1991, 1992, 1994, 1995, 1996, 1999, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Handle embedded relocs for m68k.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright 2000 Free Software Foundation, Inc.
Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on generic.em
by Steve Chamberlain <steve@cygnus.com>, embedded relocs code based on
mipsecoff.em by Ian Lance Taylor <ian@cygnus.com>.

View File

@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*-
# Copyright (C) 2000 Free Software Foundation, Inc.
# Copyright 2000, 2001 Free Software Foundation, Inc.
# Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on armelf.em
#
# This file is part of GLD, the Gnu Linker.

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Handle embedded relocs for MIPS.
Copyright 1994, 95, 97, 99, 2000 Free Software Foundation, Inc.
Copyright 1994, 1995, 1997, 2000 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em.
This file is part of GLD, the Gnu Linker.

View File

@ -4,7 +4,8 @@ rm -f e${EMULATION_NAME}.c
(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
cat >>e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker.
Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
Copyright 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -251,7 +252,7 @@ static definfo init[] =
#endif
D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
D(Subsystem,"__subsystem__", ${SUBSYSTEM}),
D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x2000000),
D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000),
D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000),

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* SunOS emulation code for ${EMULATION_NAME}
Copyright (C) 1991, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>

View File

@ -2,7 +2,7 @@
# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* A vanilla emulation with no defaults
Copyright (C) 1991, 92, 93, 94, 2000 Free Software Foundation, Inc.
Copyright 1991, 1992, 1994, 2000 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.

View File

@ -1,4 +1,5 @@
.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 1999, 2000 Free Software Foundation
.\" Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
.\" 2001 Free Software Foundation, Inc.
.\" See section COPYING for conditions for redistribution
.TH ld 1 "" "Free Software Foundation" "GNU Development Tools"
.de BP
@ -28,6 +29,7 @@ ld \- the GNU linker
.I input-format\c
\&\|]
.RB "[\|" \-Bstatic "\|]"
.RB "[\|" \-Bgroup "\|]"
.RB "[\|" \-Bdynamic "\|]"
.RB "[\|" \-Bsymbolic "\|]"
.RB "[\|" "\-c\ "\c
@ -97,7 +99,7 @@ ld \- the GNU linker
.RB "[\|" \-O\c
.I level\c
\&\|]
.RB "[\|" "\-oformat\ "\c
.RB "[\|" "\--oformat\ "\c
.I output-format\c
\&\|]
.RB "[\|" "\-R\ "\c
@ -405,6 +407,19 @@ Link against dynamic libraries. This is only meaningful on platforms
for which shared libraries are supported. This option is normally the
default on such platforms.
.TP
.B \-Bgroup
Set the \c
.B DF_1_GROUP
\c
flag in the \c
.B DT_FLAGS_1
\c
entry in the dynamic section. This causes the runtime linker to handle
lookups in this object and its dependencies to be performed only inside
the group. No undefined symbols are allowed. This option is only
meaningful on ELF platforms which support shared libraries.
.TP
.B \-Bsymbolic
When creating a shared library, bind references to global symbols to
@ -728,7 +743,7 @@ final binary.
the optimizations.
.TP
.BI "\-oformat " "output\-format"
.BI "\--oformat " "output\-format"
Specify the binary format for the output object file.
You don't usually need to specify this, as
\c

View File

@ -4,86 +4,86 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.

Indirect:
ld.info-1: 309
ld.info-2: 2594
ld.info-3: 54789
ld.info-4: 103438
ld.info-5: 153415
ld.info-6: 183904
ld.info-1: 311
ld.info-2: 2598
ld.info-3: 55192
ld.info-4: 103841
ld.info-5: 153818
ld.info-6: 184307

Tag Table:
(Indirect)
Node: Top309
Node: Overview1074
Node: Invocation2187
Node: Options2594
Node: Environment54789
Node: Scripts56544
Node: Basic Script Concepts58277
Node: Script Format60979
Node: Simple Example61837
Node: Simple Commands64927
Node: Entry Point65373
Node: File Commands66123
Node: Format Commands69176
Node: Miscellaneous Commands71132
Node: Assignments73123
Node: Simple Assignments73455
Node: PROVIDE75151
Node: SECTIONS76324
Node: Output Section Description78210
Node: Output Section Name79195
Node: Output Section Address80062
Node: Input Section81696
Node: Input Section Basics82488
Node: Input Section Wildcards84756
Node: Input Section Common87563
Node: Input Section Keep89032
Node: Input Section Example89501
Node: Output Section Data90458
Node: Output Section Keywords93211
Node: Output Section Discarding96643
Node: Output Section Attributes97588
Node: Output Section Type98422
Node: Output Section LMA99563
Node: Output Section Region101667
Node: Output Section Phdr102080
Node: Output Section Fill102731
Node: Overlay Description103438
Node: MEMORY107677
Node: PHDRS111754
Node: VERSION116793
Node: Expressions122871
Node: Constants123705
Node: Symbols124261
Node: Location Counter124993
Node: Operators127298
Node: Evaluation128209
Node: Expression Section129563
Node: Builtin Functions131039
Node: Implicit Linker Scripts136041
Node: Machine Dependent136809
Node: H8/300137370
Node: i960138166
Node: ARM139846
Node: HPPA ELF32141000
Node: TI COFF142621
Node: BFD143129
Node: BFD outline144583
Node: BFD information loss145868
Node: Canonical format148376
Node: Reporting Bugs152722
Node: Bug Criteria153415
Node: Bug Reporting154109
Node: MRI160869
Node: GNU Free Documentation License165493
Node: Index183904
Node: Top311
Node: Overview1078
Node: Invocation2191
Node: Options2598
Node: Environment55192
Node: Scripts56947
Node: Basic Script Concepts58680
Node: Script Format61382
Node: Simple Example62240
Node: Simple Commands65330
Node: Entry Point65776
Node: File Commands66526
Node: Format Commands69579
Node: Miscellaneous Commands71535
Node: Assignments73526
Node: Simple Assignments73858
Node: PROVIDE75554
Node: SECTIONS76727
Node: Output Section Description78613
Node: Output Section Name79598
Node: Output Section Address80465
Node: Input Section82099
Node: Input Section Basics82891
Node: Input Section Wildcards85159
Node: Input Section Common87966
Node: Input Section Keep89435
Node: Input Section Example89904
Node: Output Section Data90861
Node: Output Section Keywords93614
Node: Output Section Discarding97046
Node: Output Section Attributes97991
Node: Output Section Type98825
Node: Output Section LMA99966
Node: Output Section Region102070
Node: Output Section Phdr102483
Node: Output Section Fill103134
Node: Overlay Description103841
Node: MEMORY108080
Node: PHDRS112157
Node: VERSION117196
Node: Expressions123274
Node: Constants124108
Node: Symbols124664
Node: Location Counter125396
Node: Operators127701
Node: Evaluation128612
Node: Expression Section129966
Node: Builtin Functions131442
Node: Implicit Linker Scripts136444
Node: Machine Dependent137212
Node: H8/300137773
Node: i960138569
Node: ARM140249
Node: HPPA ELF32141403
Node: TI COFF143024
Node: BFD143532
Node: BFD outline144986
Node: BFD information loss146271
Node: Canonical format148779
Node: Reporting Bugs153125
Node: Bug Criteria153818
Node: Bug Reporting154512
Node: MRI161272
Node: GNU Free Documentation License165896
Node: Index184307

End Tag Table

View File

@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.
@ -15,7 +15,7 @@ File: ld.info, Node: Top, Next: Overview, Up: (dir)
Using ld
********
This file documents the GNU linker ld version 2.11.
This file documents the GNU linker ld version 2.11.2.
This document is distributed under the terms of the GNU Free
Documentation License. A copy of the license is included in the

View File

@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.
@ -485,6 +485,7 @@ GNU linker:
available to `dlopen'. `nodump' marks the object can not be
dumped by `dldump'. `now' marks the object with the non-lazy
runtime binding. `origin' marks the object may contain $ORIGIN.
`defs' disallows undefined symbols.
`-( ARCHIVES -)'
`--start-group ARCHIVES --end-group'
@ -517,6 +518,13 @@ GNU linker:
may use this option multiple times on the command line: it affects
library searching for `-l' options which follow it.
`-Bgroup'
Set the `DF_1_GROUP' flag in the `DT_FLAGS_1' entry in the dynamic
section. This causes the runtime linker to handle lookups in this
object and its dependencies to be performed only inside the group.
`--no-undefined' is implied. This option is only meaningful on ELF
platforms which support shared libraries.
`-Bstatic'
`-dn'
`-non_shared'
@ -636,9 +644,10 @@ GNU linker:
space while linking a large executable.
`--no-undefined'
`-z defs'
Normally when creating a non-symbolic shared library, undefined
symbols are allowed and left to be resolved by the runtime loader.
This option disallows such undefined symbols.
These options disallow such undefined symbols.
`--allow-shlib-undefined'
Allow undefined symbols in shared objects even when -no-undefined

View File

@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.

View File

@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.

View File

@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.

View File

@ -4,7 +4,7 @@ START-INFO-DIR-ENTRY
* Ld: (ld). The GNU linker.
END-INFO-DIR-ENTRY
This file documents the GNU linker LD version 2.11.
This file documents the GNU linker LD version 2.11.2.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free
Software Foundation, Inc.
@ -116,6 +116,7 @@ Index
* -assert KEYWORD: Options.
* -b FORMAT: Options.
* -Bdynamic: Options.
* -Bgroup: Options.
* -Bshareable: Options.
* -Bstatic: Options.
* -Bsymbolic: Options.
@ -173,6 +174,7 @@ Index
* -x: Options.
* -Y PATH: Options.
* -y SYMBOL: Options.
* -z defs: Options.
* -z KEYWORD: Options.
* .: Location Counter.
* /DISCARD/: Output Section Discarding.

View File

@ -1,5 +1,7 @@
\input texinfo
@setfilename ld.info
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
@c 2001 Free Software Foundation, Inc.
@syncodeindex ky cp
@include configdoc.texi
@c (configdoc.texi is generated by the Makefile)
@ -299,7 +301,7 @@ You may want to use this option if you are linking files with an unusual
binary format. You can also use @samp{-b} to switch formats explicitly (when
linking object files of different formats), by including
@samp{-b @var{input-format}} before each group of object files in a
particular format.
particular format.
The default format is taken from the environment variable
@code{GNUTARGET}.
@ -327,7 +329,7 @@ specified by any @samp{-L} options.
@kindex -d
@kindex -dc
@kindex -dp
@item -d
@item -d
@itemx -dc
@itemx -dp
These three options are equivalent; multiple forms are supported for
@ -339,7 +341,7 @@ script command @code{FORCE_COMMON_ALLOCATION} has the same effect.
@cindex entry point, from command line
@kindex -e @var{entry}
@kindex --entry=@var{entry}
@item -e @var{entry}
@item -e @var{entry}
@itemx --entry=@var{entry}
Use @var{entry} as the explicit symbol for beginning execution of your
program, rather than the default entry point. If there is no symbol
@ -509,7 +511,7 @@ behaviour of the AIX linker.
@cindex search directory, from cmd line
@kindex -L@var{dir}
@kindex --library-path=@var{dir}
@item -L@var{searchdir}
@item -L@var{searchdir}
@itemx --library-path=@var{searchdir}
Add path @var{searchdir} to the list of paths that @code{ld} will search
for archive libraries and @code{ld} control scripts. You may use this
@ -566,13 +568,13 @@ which caused the archive member to be brought in.
@item -n
@itemx --nmagic
Turn off page alignment of sections, and mark the output as
@code{NMAGIC} if possible.
@code{NMAGIC} if possible.
@kindex -N
@kindex --omagic
@cindex read/write from cmd line
@cindex OMAGIC
@item -N
@item -N
@itemx --omagic
Set the text and data sections to be readable and writable. Also, do
not page-align the data segment. If the output format supports Unix
@ -615,7 +617,7 @@ turn serve as input to @code{ld}. This is often called @dfn{partial
linking}. As a side effect, in environments that support standard Unix
magic numbers, this option also sets the output file's magic number to
@code{OMAGIC}.
@c ; see @code{-N}.
@c ; see @code{-N}.
If this option is not specified, an absolute file is produced. When
linking C++ programs, this option @emph{will not} resolve references to
constructors; to do that, use @samp{-Ur}.
@ -639,21 +641,21 @@ the @code{-rpath} option.
@kindex -s
@kindex --strip-all
@cindex strip all symbols
@item -s
@item -s
@itemx --strip-all
Omit all symbol information from the output file.
@kindex -S
@kindex --strip-debug
@cindex strip debugger symbols
@item -S
@item -S
@itemx --strip-debug
Omit debugger symbol information (but not all symbols) from the output file.
@kindex -t
@kindex --trace
@cindex input files, displaying
@item -t
@item -t
@itemx --trace
Print the names of the input files as @code{ld} processes them.
@ -685,7 +687,7 @@ option is equivalent to the @code{EXTERN} linker script command.
@kindex -Ur
@cindex constructors
@item -Ur
@item -Ur
For anything other than C++ programs, this option is equivalent to
@samp{-r}: it generates relocatable output---i.e., an output file that can in
turn serve as input to @code{ld}. When linking C++ programs, @samp{-Ur}
@ -726,7 +728,7 @@ Delete all local symbols.
@kindex --discard-locals
@cindex local symbols, deleting
@cindex L, deleting symbols beginning
@item -X
@item -X
@itemx --discard-locals
Delete all temporary local symbols. For most targets, this is all local
symbols whose names begin with @samp{L}.
@ -765,6 +767,7 @@ of this object will ignore any default library search paths.
@code{nodump} marks the object can not be dumped by @code{dldump}.
@code{now} marks the object with the non-lazy runtime binding.
@code{origin} marks the object may contain $ORIGIN.
@code{defs} disallows undefined symbols.
@kindex -(
@cindex groups of archives
@ -803,11 +806,19 @@ for compatibility with various systems. You may use this option
multiple times on the command line: it affects library searching for
@code{-l} options which follow it.
@kindex -Bgroup
@item -Bgroup
Set the @code{DF_1_GROUP} flag in the @code{DT_FLAGS_1} entry in the dynamic
section. This causes the runtime linker to handle lookups in this
object and its dependencies to be performed only inside the group.
@code{--no-undefined} is implied. This option is only meaningful on ELF
platforms which support shared libraries.
@kindex -Bstatic
@kindex -dn
@kindex -non_shared
@kindex -static
@item -Bstatic
@item -Bstatic
@itemx -dn
@itemx -non_shared
@itemx -static
@ -873,9 +884,9 @@ These options control whether to demangle symbol names in error messages
and other output. When the linker is told to demangle, it tries to
present symbol names in a readable fashion: it strips leading
underscores if they are used by the object file format, and converts C++
mangled symbol names into user readable names. Different compilers have
different mangling styles. The optional demangling style argument can be used
to choose an appropriate demangling style for your compiler. The linker will
mangled symbol names into user readable names. Different compilers have
different mangling styles. The optional demangling style argument can be used
to choose an appropriate demangling style for your compiler. The linker will
demangle by default unless the environment variable @samp{COLLECT_NO_DEMANGLE}
is set. These options may be used to override the default.
@ -943,10 +954,12 @@ necessary. This may be required if @code{ld} runs out of memory space
while linking a large executable.
@kindex --no-undefined
@kindex -z defs
@item --no-undefined
@itemx -z defs
Normally when creating a non-symbolic shared library, undefined symbols
are allowed and left to be resolved by the runtime loader. This option
disallows such undefined symbols.
are allowed and left to be resolved by the runtime loader. These options
disallow such undefined symbols.
@kindex --allow-shlib-undefined
@item --allow-shlib-undefined
@ -1012,7 +1025,7 @@ This option is ignored for SVR4 compatibility.
@cindex synthesizing linker
@cindex relaxing addressing modes
@item --relax
An option with machine dependent effects.
An option with machine dependent effects.
@ifset GENERIC
This option is only supported on a few targets.
@end ifset
@ -1847,15 +1860,15 @@ There are several ways to set the entry point. The linker will set the
entry point by trying each of the following methods in order, and
stopping when one of them succeeds:
@itemize @bullet
@item
@item
the @samp{-e} @var{entry} command-line option;
@item
@item
the @code{ENTRY(@var{symbol})} command in a linker script;
@item
@item
the value of the symbol @code{start}, if defined;
@item
@item
the address of the first byte of the @samp{.text} section, if present;
@item
@item
The address @code{0}.
@end itemize
@ -2214,7 +2227,7 @@ in the first input file. The first section will be at address zero.
@subsection Output section description
The full description of an output section looks like this:
@smallexample
@group
@group
@var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})]
@{
@var{output-section-command}
@ -2505,7 +2518,7 @@ notation is now considered obsolete. It is equivalent to
@cindex KEEP
@cindex garbage collection
When link-time garbage collection is in use (@samp{--gc-sections}),
it is often useful to mark sections that should not be eliminated.
it is often useful to mark sections that should not be eliminated.
This is accomplished by surrounding an input section's wildcard entry
with @code{KEEP()}, as in @code{KEEP(*(.init))} or
@code{KEEP(SORT(*)(.ctors))}.
@ -2542,7 +2555,7 @@ SECTIONS @{
@}
@}
@end group
@end smallexample
@end smallexample
@node Output Section Data
@subsection Output section data
@ -2729,7 +2742,7 @@ section named @samp{/DISCARD/} are not included in the output file.
We showed above that the full description of an output section looked
like this:
@smallexample
@group
@group
@var{section} [@var{address}] [(@var{type})] : [AT(@var{lma})]
@{
@var{output-section-command}
@ -2742,7 +2755,7 @@ We've already described @var{section}, @var{address}, and
@var{output-section-command}. In this section we will describe the
remaining section attributes.
@menu
@menu
* Output Section Type:: Output section type
* Output Section LMA:: Output section LMA
* Output Section Region:: Output section region
@ -2820,7 +2833,7 @@ counter holds the VMA value, not the LMA value.
SECTIONS
@{
.text 0x1000 : @{ *(.text) _etext = . ; @}
.mdata 0x2000 :
.mdata 0x2000 :
AT ( ADDR (.text) + SIZEOF (.text) )
@{ _data = . ; *(.data); _edata = . ; @}
.bss 0x3000 :
@ -3047,7 +3060,7 @@ command. However, you can define as many blocks of memory within it as
you wish. The syntax is:
@smallexample
@group
MEMORY
MEMORY
@{
@var{name} [(@var{attr})] : ORIGIN = @var{origin}, LENGTH = @var{len}
@dots{}
@ -3122,7 +3135,7 @@ region.
@smallexample
@group
MEMORY
MEMORY
@{
rom (rx) : ORIGIN = 0, LENGTH = 256K
ram (!rx) : org = 0x40000000, l = 4M
@ -3326,9 +3339,9 @@ VERS_1.1 @{
global:
foo1;
local:
old*;
original*;
new*;
old*;
original*;
new*;
@};
VERS_1.2 @{
@ -3610,7 +3623,7 @@ precedence associativity Operators Notes
(lowest)
@end smallexample
Notes:
(1) Prefix operators
(1) Prefix operators
(2) @xref{Assignments}.
@c TEXI2ROFF-KILL
@end ifinfo
@ -3628,7 +3641,7 @@ height2pt&\omit&&\omit&&\omit&\cr
height2pt&\omit&&\omit&&\omit&\cr
&highest&&&&&\cr
% '176 is tilde, '~' in tt font
&1&&left&&\qquad- \char'176\ !\qquad\dag&\cr
&1&&left&&\qquad- \char'176\ !\qquad\dag&\cr
&2&&left&&* / \%&\cr
&3&&left&&+ -&\cr
&4&&left&&>> <<&\cr
@ -3683,7 +3696,7 @@ following
@group
SECTIONS
@{
.text 9+this_isnt_constant :
.text 9+this_isnt_constant :
@{ *(.text) @}
@}
@end group
@ -3758,7 +3771,7 @@ identical values:
@group
SECTIONS @{ @dots{}
.output1 :
@{
@{
start_of_output_1 = ABSOLUTE(.);
@dots{}
@}
@ -4071,7 +4084,7 @@ non-interworking aware Thumb code.
@cindex entry point, thumb
@kindex --thumb-entry=@var{entry}
The @samp{--thumb-entry} switch is a duplicate of the generic
@samp{--entry} switch, in that it sets the program's starting address.
@samp{--entry} switch, in that it sets the program's starting address.
But it also sets the bottom bit of the address, so that it can be
branched to using a BX instruction, and the program will start
executing in Thumb mode straight away.
@ -4449,10 +4462,10 @@ This command does nothing whatever; it's only accepted for compatibility.
@cindex @code{FORMAT} (MRI)
@item FORMAT @var{output-format}
Similar to the @code{OUTPUT_FORMAT} command in the more general linker
language, but restricted to one of these output formats:
language, but restricted to one of these output formats:
@enumerate
@item
@item
S-records, if @var{output-format} is @samp{S}
@item
@ -4515,12 +4528,12 @@ If you have more than one @code{SECT} statement for the same
@cindex GNU Free Documentation License
GNU Free Documentation License
Version 1.1, March 2000
Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

View File

@ -1,5 +1,5 @@
/* ldcref.c -- output a cross reference table
Copyright (C) 1996, 97, 98, 99, 2000 Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* ldctor.c -- constructor support routines
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>

View File

@ -1,5 +1,6 @@
/* ldctor.h - linker constructor support
Copyright 1991, 92, 93, 94, 95, 98, 2000 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* ldemul.c -- clearing house for ld emulation states
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* ld-emul.h - Linker emulation header file
Copyright 1991, 92, 93, 94, 95, 96, 97, 1998, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,6 @@
/* This module handles expression trees.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
@ -593,10 +594,11 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
case etree_assign:
case etree_provide:
case etree_provided:
if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
{
/* Assignment to dot can only be done during allocation */
if (tree->type.node_class == etree_provide)
if (tree->type.node_class != etree_assign)
einfo (_("%F%S can not PROVIDE assignment to location counter\n"));
if (allocation_done == lang_allocating_phase_enum
|| (allocation_done == lang_final_phase_enum
@ -666,6 +668,8 @@ exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
h->type = bfd_link_hash_defined;
h->u.def.value = result.value;
h->u.def.section = result.section->bfd_section;
if (tree->type.node_class == etree_provide)
tree->type.node_class = etree_provided;
}
}
}
@ -880,6 +884,7 @@ exp_print_tree (tree)
exp_print_tree (tree->assign.src);
break;
case etree_provide:
case etree_provided:
fprintf (config.map_file, "PROVIDE (%s, ", tree->assign.dst);
exp_print_tree (tree->assign.src);
fprintf (config.map_file, ")");

View File

@ -1,5 +1,5 @@
/* ldexp.h -
Copyright 1991, 92, 93, 94, 95, 98, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -37,6 +37,7 @@ typedef struct {
etree_name,
etree_assign,
etree_provide,
etree_provided,
etree_undef,
etree_unspec,
etree_value,

View File

@ -1,5 +1,5 @@
/* Linker file opening and searching.
Copyright (C) 1991, 92, 93, 94, 95, 98, 99, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ldgram.h"
#include "ldlex.h"
#include "ldemul.h"
#include "libiberty.h"
#include <ctype.h>
@ -231,23 +232,32 @@ ldfile_open_file (entry)
else
{
search_arch_type *arch;
boolean found = false;
/* Try to open <filename><suffix> or lib<filename><suffix>.a */
for (arch = search_arch_head;
arch != (search_arch_type *) NULL;
arch = arch->next)
{
if (ldfile_open_file_search (arch->name, entry, "lib", ".a"))
return;
found = ldfile_open_file_search (arch->name, entry, "lib", ".a");
if (found)
break;
#ifdef VMS
if (ldfile_open_file_search (arch->name, entry, ":lib", ".a"))
return;
found = ldfile_open_file_search (arch->name, entry, ":lib", ".a");
if (found)
break;
#endif
if (ldemul_find_potential_libraries (arch->name, entry))
return;
found = ldemul_find_potential_libraries (arch->name, entry);
if (found)
break;
}
einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name);
/* If we have found the file, we don't need to search directories
again. */
if (found)
entry->search_dirs_flag = false;
else
einfo (_("%F%P: cannot find %s\n"), entry->local_sym_name);
}
}
@ -405,7 +415,7 @@ void
ldfile_add_arch (in_name)
CONST char *in_name;
{
char *name = buystring (in_name);
char *name = xstrdup (in_name);
search_arch_type *new =
(search_arch_type *) xmalloc (sizeof (search_arch_type));

View File

@ -1,5 +1,6 @@
/* ldfile.h -
Copyright 1991, 92, 93, 94, 95, 2000 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1994, 1995, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,6 @@
/* Linker command language support.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -41,9 +42,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <ctype.h>
/* FORWARDS */
static lang_statement_union_type *new_statement PARAMS ((enum statement_enum,
size_t,
lang_statement_list_type *));
static lang_statement_union_type *new_statement
PARAMS ((enum statement_enum, size_t, lang_statement_list_type *));
/* LOCALS */
static struct obstack stat_obstack;
@ -190,18 +190,22 @@ struct unique_sections *unique_section_list;
etree_type *base; /* Relocation base - or null */
#if defined(__STDC__) || defined(ALMOST_STDC)
#if defined (__STDC__) || defined (ALMOST_STDC)
#define cat(a,b) a##b
#else
#define cat(a,b) a/**/b
#endif
/* Don't beautify the line below with "innocent" whitespace, it breaks the K&R C preprocessor! */
#define new_stat(x, y) (cat (x,_type)*) new_statement (cat (x,_enum), sizeof (cat (x,_type)), y)
/* Don't beautify the line below with "innocent" whitespace, it breaks
the K&R C preprocessor! */
#define new_stat(x, y) \
(cat (x,_type)*) new_statement (cat (x,_enum), sizeof (cat (x,_type)), y)
#define outside_section_address(q) ((q)->output_offset + (q)->output_section->vma)
#define outside_section_address(q) \
((q)->output_offset + (q)->output_section->vma)
#define outside_symbol_address(q) ((q)->value + outside_section_address (q->section))
#define outside_symbol_address(q) \
((q)->value + outside_section_address (q->section))
#define SECTION_NAME_MAP_LENGTH (16)
@ -243,14 +247,16 @@ walk_wild_section (ptr, section, file, callback, data)
if (ptr->exclude_filename_list != NULL)
{
struct name_list *list_tmp;
for (list_tmp = ptr->exclude_filename_list; list_tmp; list_tmp = list_tmp->next)
for (list_tmp = ptr->exclude_filename_list;
list_tmp;
list_tmp = list_tmp->next)
{
boolean match;
if (wildcardp (list_tmp->name))
match = fnmatch (list_tmp->name, file->filename, 0) == 0 ? true : false;
match = fnmatch (list_tmp->name, file->filename, 0) == 0;
else
match = strcmp (list_tmp->name, file->filename) == 0 ? true : false;
match = strcmp (list_tmp->name, file->filename) == 0;
if (match)
return;
@ -273,9 +279,9 @@ walk_wild_section (ptr, section, file, callback, data)
if (section == NULL)
match = true;
else if (wildcard)
match = fnmatch (section, sname, 0) == 0 ? true : false;
match = fnmatch (section, sname, 0) == 0;
else
match = strcmp (section, sname) == 0 ? true : false;
match = strcmp (section, sname) == 0;
/* If this is a wild-card output section statement, exclude
sections that match UNIQUE_SECTION_LIST. */
@ -448,7 +454,7 @@ new_statement (type, size, list)
We can be supplied with requests for input files more than once;
they may, for example be split over serveral lines like foo.o(.text)
foo.o(.data) etc, so when asked for a file we check that we havn't
foo.o(.data) etc, so when asked for a file we check that we haven't
got it already so we don't duplicate the bfd. */
static lang_input_statement_type *
@ -621,7 +627,7 @@ lang_memory_region_lookup (name)
lang_memory_region_type *new =
(lang_memory_region_type *) stat_alloc (sizeof (lang_memory_region_type));
new->name = buystring (name);
new->name = xstrdup (name);
new->next = (lang_memory_region_type *) NULL;
*lang_memory_region_list_tail = new;
@ -1134,12 +1140,10 @@ wild_doit (ptr, section, output, file)
flagword flags;
if (output->bfd_section == NULL)
{
init_os (output);
first = true;
}
else
first = false;
init_os (output);
first = ! output->bfd_section->linker_has_input;
output->bfd_section->linker_has_input = 1;
/* Add a section reference to the list. */
new = new_stat (lang_input_section, ptr);
@ -1433,6 +1437,11 @@ load_symbols (entry, place)
lang_statement_list_type *hold;
err = bfd_get_error ();
/* See if the emulation has some special knowledge. */
if (ldemul_unrecognized_file (entry))
return;
if (err == bfd_error_file_ambiguously_recognized)
{
char **p;
@ -1450,13 +1459,7 @@ load_symbols (entry, place)
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
/* See if the emulation has some special knowledge. */
if (ldemul_unrecognized_file (entry))
return;
/* Try to interpret the file as a linker script. */
ldfile_open_command_file (entry->filename);
hold = stat_ptr;
@ -1675,7 +1678,8 @@ closest_target_match (target, data)
/* Oh dear, we now have two potential candidates for a successful match.
Compare their names and choose the better one. */
if (name_compare (target->name, original->name) > name_compare (winner->name, original->name))
if (name_compare (target->name, original->name)
> name_compare (winner->name, original->name))
winner = target;
/* Keep on searching until wqe have checked them all. */
@ -1771,7 +1775,8 @@ open_output (name)
/* Try to find a target as similar as possible to
the default target, but which has the desired
endian characteristic. */
(void) bfd_search_for_target (closest_target_match, (PTR) target);
(void) bfd_search_for_target (closest_target_match,
(PTR) target);
/* Oh dear - we could not find any targets that
satisfy our requirements. */
@ -1971,7 +1976,7 @@ ldlang_add_undef (name)
new->next = ldlang_undef_chain_list_head;
ldlang_undef_chain_list_head = new;
new->name = buystring (name);
new->name = xstrdup (name);
}
/* Run through the list of undefineds created above and place them
@ -2664,7 +2669,8 @@ size_input_section (this_ptr, output_section_statement, fill, dot, relax)
}
#define IGNORE_SECTION(bfd, s) \
(((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_LOAD)) != (SEC_ALLOC | SEC_LOAD)) \
(((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_LOAD)) \
!= (SEC_ALLOC | SEC_LOAD)) \
|| bfd_section_size (bfd, s) == 0)
/* Check to see if any allocated sections overlap with other allocated
@ -2787,8 +2793,9 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
case lang_output_section_statement_enum:
{
bfd_vma after;
lang_output_section_statement_type *os = &s->output_section_statement;
lang_output_section_statement_type *os;
os = &s->output_section_statement;
if (os->bfd_section == NULL)
/* This section was never actually created. */
break;
@ -2843,10 +2850,12 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
&& ! link_info.relocateable
&& strcmp (os->region->name, "*default*") == 0
&& lang_memory_region_list != NULL
&& (strcmp (lang_memory_region_list->name, "*default*") != 0
&& (strcmp (lang_memory_region_list->name,
"*default*") != 0
|| lang_memory_region_list->next != NULL))
einfo (_("%P: warning: no memory region specified for section `%s'\n"),
bfd_get_section_name (output_bfd, os->bfd_section));
bfd_get_section_name (output_bfd,
os->bfd_section));
dot = os->region->current;
@ -2855,7 +2864,8 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
bfd_vma olddot;
olddot = dot;
dot = align_power (dot, os->bfd_section->alignment_power);
dot = align_power (dot,
os->bfd_section->alignment_power);
if (dot != olddot && config.warn_section_align)
einfo (_("%P: warning: changing start of section %s by %u bytes\n"),
@ -3172,9 +3182,9 @@ lang_do_assignments (s, output_section_statement, fill, dot)
case lang_output_section_statement_enum:
{
lang_output_section_statement_type *os =
&(s->output_section_statement);
lang_output_section_statement_type *os;
os = &(s->output_section_statement);
if (os->bfd_section != NULL)
{
dot = os->bfd_section->vma;
@ -3347,8 +3357,10 @@ lang_set_startof ()
h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true);
if (h != NULL && h->type == bfd_link_hash_undefined)
{
unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine);
unsigned opb;
opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine);
h->type = bfd_link_hash_defined;
if (s->_cooked_size != 0)
h->u.def.value = s->_cooked_size / opb;
@ -4181,8 +4193,9 @@ lang_section_start (name, address)
const char *name;
etree_type *address;
{
lang_address_statement_type *ad = new_stat (lang_address_statement, stat_ptr);
lang_address_statement_type *ad;
ad = new_stat (lang_address_statement, stat_ptr);
ad->section_name = name;
ad->address = address;
}
@ -4575,9 +4588,7 @@ lang_record_phdrs ()
lang_final_phase_enum);
if (! bfd_record_phdr (output_bfd, l->type,
l->flags == NULL ? false : true,
flags,
l->at == NULL ? false : true,
l->flags != NULL, flags, l->at != NULL,
at, l->filehdr, l->phdrs, c, secs))
einfo (_("%F%P: bfd_record_phdr failed: %E\n"));
}

View File

@ -1,5 +1,6 @@
/* ldlang.h - linker command language support
Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,6 @@
/* ldlex.h -
Copyright 1991, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,6 +1,6 @@
%{
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -45,6 +45,7 @@ This was written by steve chamberlain
#include "ldfile.h"
#include "ldlex.h"
#include "ldmain.h"
#include "libiberty.h"
/* The type of top-level parser input.
yylex and yyparse (indirectly) both check this. */
@ -147,7 +148,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<DEFSYMEXP>"-" { RTOKEN('-');}
<DEFSYMEXP>"+" { RTOKEN('+');}
<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; }
<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup(yytext); return NAME; }
<DEFSYMEXP>"=" { RTOKEN('='); }
<MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
@ -333,17 +334,17 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
/* Filename without commas, needed to parse mri stuff */
yylval.name = buystring(yytext);
yylval.name = xstrdup(yytext);
return NAME;
}
<BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
yylval.name = buystring(yytext);
yylval.name = xstrdup(yytext);
return NAME;
}
<BOTH,EXPRESSION>"-l"{FILENAMECHAR}+ {
yylval.name = buystring (yytext + 2);
yylval.name = xstrdup (yytext + 2);
return LNAME;
}
<SCRIPT>{WILDCHAR}* {
@ -358,7 +359,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
}
else
{
yylval.name = buystring(yytext);
yylval.name = xstrdup(yytext);
return NAME;
}
}
@ -366,7 +367,7 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<EXPRESSION,BOTH,SCRIPT,VERS_NODE>"\""[^\"]*"\"" {
/* No matter the state, quotes
give what's inside */
yylval.name = buystring(yytext+1);
yylval.name = xstrdup(yytext+1);
yylval.name[yyleng-2] = 0;
return NAME;
}
@ -381,10 +382,10 @@ V_IDENTIFIER [*?.$_a-zA-Z]([*?.$_a-zA-Z0-9]|::)*
<VERS_NODE>extern { RTOKEN(EXTERN); }
<VERS_NODE>{V_IDENTIFIER} { yylval.name = buystring (yytext);
<VERS_NODE>{V_IDENTIFIER} { yylval.name = xstrdup (yytext);
return VERS_IDENTIFIER; }
<VERS_SCRIPT>{V_TAG} { yylval.name = buystring (yytext);
<VERS_SCRIPT>{V_TAG} { yylval.name = xstrdup (yytext);
return VERS_TAG; }
<VERS_START>"{" { BEGIN(VERS_SCRIPT); return *yytext; }

View File

@ -1,5 +1,6 @@
/* ldmain.h -
Copyright 1991, 92, 93, 94, 95, 96, 1999 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1999
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* ldmisc.c
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
@ -335,10 +335,10 @@ vfinfo (fp, fmt, arg)
last_bfd = abfd;
if (last_file != NULL)
free (last_file);
last_file = buystring (filename);
last_file = xstrdup (filename);
if (last_function != NULL)
free (last_function);
last_function = buystring (functionname);
last_function = xstrdup (functionname);
}
discard_last = false;
if (linenumber != 0)
@ -464,16 +464,6 @@ info_assert (file, line)
einfo (_("%F%P: internal error %s %d\n"), file, line);
}
char *
buystring (x)
CONST char *CONST x;
{
size_t l = strlen (x) + 1;
char *r = xmalloc (l);
memcpy (r, x, l);
return r;
}
/* ('m' for map) Format info message and print on map. */
void

View File

@ -1,5 +1,6 @@
/* ldmisc.h -
Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1994, 1996, 1997
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@ -41,7 +42,6 @@ extern void yyerror PARAMS ((const char *));
extern PTR xmalloc PARAMS ((size_t));
extern PTR xrealloc PARAMS ((PTR, size_t));
extern void xexit PARAMS ((int));
extern char *buystring PARAMS ((CONST char *CONST));
#define ASSERT(x) \
do { if (!(x)) info_assert(__FILE__,__LINE__); } while (0)

View File

@ -1,5 +1,5 @@
/* ldver.c -- Print linker version.
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* ldver.h -- Header file for ldver.c.
Copyright (C) 1991, 92, 93, 95, 1996 Free Software Foundation, Inc.
Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1 +1 @@
@set VERSION 2.11
@set VERSION 2.11.2

View File

@ -1,5 +1,5 @@
/* ldwrite.c -- write out the linked file
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 2000
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain sac@cygnus.com

View File

@ -1,7 +1,7 @@
/* This file is is generated by a shell script. DO NOT EDIT! */
/* 32 bit ELF emulation code for elf32ebmip
Copyright (C) 1991, 93, 94, 95, 96, 98, 2000
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
@ -522,6 +522,7 @@ gldelf32ebmip_find_exp_assignment (exp)
switch (exp->type.node_class)
{
case etree_provide:
case etree_provided:
h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
false, false, false);
if (h == NULL)
@ -541,7 +542,7 @@ gldelf32ebmip_find_exp_assignment (exp)
{
if (! (bfd_elf32_record_link_assignment
(output_bfd, &link_info, exp->assign.dst,
exp->type.node_class == etree_provide ? true : false)))
exp->type.node_class != etree_assign ? true : false)))
einfo (_("%P%F: failed to record assignment to %s: %E\n"),
exp->assign.dst);
}

View File

@ -1,7 +1,8 @@
/* This file is is generated by a shell script. DO NOT EDIT! */
/* AIX emulation code for ppcmacos
Copyright (C) 1991, 93, 95, 98, 2000 Free Software Foundation, Inc.
Copyright 1991, 1993, 1995, 1996, 1997, 2000
Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com>
@ -842,7 +843,7 @@ gldppcmacos_read_file (filename, import)
n = ((struct export_symbol_list *)
xmalloc (sizeof (struct export_symbol_list)));
n->next = export_symbols;
n->name = buystring (symname);
n->name = xstrdup (symname);
n->syscall = syscall;
export_symbols = n;
}

View File

@ -1,7 +1,7 @@
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given sh
Copyright (C) 1991, 1993, 2000 Free Software Foundation, Inc.
Copyright 1991, 1993, 1995, 2000 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.

View File

@ -1,7 +1,7 @@
/* This file is is generated by a shell script. DO NOT EDIT! */
/* Handle embedded relocs for MIPS.
Copyright 1994, 2000 Free Software Foundation, Inc.
Copyright 1994, 1997, 2000 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* mri.c -- handle MRI style linker scripts
Copyright 1991, 92, 93, 94, 95, 96, 1997, 1998, 2000
Copyright 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* mri.h -- header file for MRI scripting functions
Copyright 1993, 95, 1996 Free Software Foundation, Inc.
Copyright 1993, 1995, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* Routines to help build PEI-format DLLs (Win32 etc)
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Written by DJ Delorie <dj@cygnus.com>
This file is part of GLD, the Gnu Linker.

View File

@ -1,5 +1,5 @@
/* pe-dll.h: Header file for routines used to build Windows DLLs.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,6 +1,7 @@
deffile.h
emultempl/armcoff.em
emultempl/pe.em
ld.h
ldcref.c
ldctor.c
ldctor.h
@ -10,7 +11,6 @@ ldexp.c
ldexp.h
ldfile.c
ldfile.h
ld.h
ldlang.c
ldlang.h
ldlex.h

View File

@ -1,5 +1,5 @@
/* sysdep.h -- handle host dependencies for the GNU linker
Copyright (C) 1995, 96, 1997 Free Software Foundation, Inc.
Copyright 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.

View File

@ -1,3 +1,64 @@
2001-06-11 Alan Modra <amodra@bigpond.net.au>
Merge from mainline.
2001-06-06 H.J. Lu <hjl@gnu.org>
* ld-bootstrap/bootstrap.exp: Rebuild tmpdir/ld2 with tmpdir/ld3
on Linux/mips.
* ld-elfvers/vers.exp: Also run on Linux/mips.
* ld-elfvsb/elfvsb.exp: Likewise.
* ld-shared/shared.exp: Likewise.
* ld-selective/selective.exp: Mark selective2, selective3,
selective4 and selective5 xfail on Linux/mips.
* ld-shared/main.c: Skip invalid -Bsymbolic tests on Linux/mips.
* symbolic.dat: Remove invalid -Bsymbolic tests on Linux/mips.
* ld-srec/srec.exp: Add Linux/mips to xfail.
2001-05-24 H.J. Lu <hjl@gnu.org>
* ld-scripts/phdrs.exp: Add sparc64 to 64 bit platform.
2001-05-25 Alan Modra <amodra@one.net.au>
* ld-elfvers/vers.exp: Replace linuxoldld with linux*oldld and
linuxaout with linux*aout.
2001-05-01 Andreas Jaeger <aj@suse.de>, Andreas Schwab <schwab@suse.de>
* ld-scripts/phdrs.exp: Fix regexp, s390x is 64 bit platform.
* ld-scripts/phdrs.t: Use startaddress that's greater than any
MAXPAGESIZE used.
2001-04-29 H.J. Lu <hjl@gnu.org>
* ld-shared/symbolic.dat: New.
* ld-shared/shared.exp: Also check -Bsymbolic.
2001-03-06 DJ Delorie <dj@redhat.com>
* ld-scripts/cross2.t: Support any type of text/data sections, not
just the canonical ones.
2001-02-28 Matt Hiller <hiller@redhat.com>
* ld-scripts/crossref.exp: Initialize flags to [big_or_little_endian].
* ld-undefined/undefined.exp: Ditto, and include $flags in ld
invocations.
* lib/ld-lib.exp (big_or_little_endian): Recognize -EB, -eb, -EL
and -el.
(is_endian_output_format): New function.
(default_ld_link): Set flags to [big_or_little_endian] only if ld
is being invoked such that the output format being used is of
known endianness.
(default_ld_simple_link): Ditto.
2001-02-14 H.J. Lu <hjl@gnu.org>
* ld-bootstrap/bootstrap.exp: Rebuild tmpdir/ld2 with tmpdir/ld3
for -static on ia64.
* ld-checks/checks.exp: Don't run on ia64-*-elf* nor
ia64-*-linux*.
* ld-elfvers/vers.exp: Also run ia64-*-elf* and ia64-*-linux*.
* ld-elfvsb/elfvsb.exp: Use i?86-*-*. Also run on ia64-*-linux*.
Set up expected failures for ia64-*-linux*.
* ld-shared/shared.exp: Likewise.
2001-06-07 Alan Modra <amodra@bigpond.net.au>
* Many files: Update copyright notices.
2001-04-01 David O'Brien <obrien@FreeBSD.org>
* ld-bootstrap/bootstrap.exp: FreeBSD 4.3+ will fail on the --static test

View File

@ -1,5 +1,6 @@
# Basic expect script for LD Regression Tests
# Copyright (C) 1993, 94, 95, 97, 98, 1999 Free Software Foundation
# Copyright 1993, 1994, 1995, 1997, 1998, 1999
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

Some files were not shown because too many files have changed in this diff Show More