diff options
author | Nick Clifton <nickc@redhat.com> | 2000-05-17 19:38:53 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-05-17 19:38:53 +0000 |
commit | a712da2085bdea09bc56b3a59eb31cf2ab024e00 (patch) | |
tree | 9d61a41f3e2b546bf10eacd972952c6118c70970 /ld | |
parent | f4bd37dad4bc492df305f32652ba812fef893420 (diff) | |
download | gdb-a712da2085bdea09bc56b3a59eb31cf2ab024e00.zip gdb-a712da2085bdea09bc56b3a59eb31cf2ab024e00.tar.gz gdb-a712da2085bdea09bc56b3a59eb31cf2ab024e00.tar.bz2 |
Apply patch from Richard Gorton <gorton@scrugs.lkg.dec.com> to implement
--emit-relocs switch to the linker to preserve relocs in an output executable
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 9 | ||||
-rw-r--r-- | ld/NEWS | 6 | ||||
-rw-r--r-- | ld/ld.texinfo | 10 | ||||
-rw-r--r-- | ld/ldmain.c | 3 | ||||
-rw-r--r-- | ld/lexsup.c | 5 |
5 files changed, 32 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 38bebc7..5465848 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2000-05-17 S. Bharadwaj Yadavalli <sby@scrugs.lkg.dec.com> + Rick Gorton <gorton@scrugs.lkg.dec.com> + + Add support for '-q' == '--emit-relocs' switch. + * ldmain.c (main): Default to false. + * lexsup.c (parse_args): Turn on emitrelocations flag if set. + * NEWS: Describe the emitrelocations switch. + * ld.texinfo: Describe the emitrelocations switch. + 2000-05-16 Charles Wilson <cwilson@ece.gatech.edu> * ld/emultempl/pe.em (_open_dynamic_archive): New function: Search @@ -2,6 +2,12 @@ Changes in version 2.10: +* Added ability to emit full relocation information in linked executables, + enabled by --emit-relocs. Some post-linkage optimization tools need + this information in order to be able to correctly identify and perform + symbol relative addressing in the event of changes in section contents + (instructions being added or deleted, extending data sections, etc.) + * Added AT> to the linker script language to allow load-time allocation of sections into regions. diff --git a/ld/ld.texinfo b/ld/ld.texinfo index e8c11d9..1ff0ecb 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -588,6 +588,16 @@ If @var{level} is a numeric values greater than zero @code{ld} optimizes the output. This might take significantly longer and therefore probably should only be enabled for the final binary. +@kindex -q +@kindex --emit-relocs +@cindex retain relocations in final executable +@item -q +@itemx --emit-relocs +Leave relocation sections and contents in fully linked exececutables. +Post link analysis and optimization tools may need this information in +order to perform correct modifications of executables. This results +in larger executables. + @cindex partial link @cindex relocatable output @kindex -r diff --git a/ld/ldmain.c b/ld/ldmain.c index ba2a592..cfdbdd7 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -214,6 +214,7 @@ main (argc, argv) link_info.callbacks = &link_callbacks; link_info.relocateable = false; + link_info.emitrelocations = false; link_info.shared = false; link_info.symbolic = false; link_info.static_link = false; @@ -1150,7 +1151,7 @@ undefined_symbol (info, name, abfd, section, address, fatal) bfd *abfd; asection *section; bfd_vma address; - boolean fatal; + boolean fatal ATTRIBUTE_UNUSED; { static char *error_name; static unsigned int error_count; diff --git a/ld/lexsup.c b/ld/lexsup.c index e2aac47..e09b58a 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -205,6 +205,8 @@ static const struct ld_option ld_options[] = '\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH }, { {"relocateable", no_argument, NULL, 'r'}, 'r', NULL, N_("Generate relocateable output"), TWO_DASHES }, + { {"emit-relocs", no_argument, NULL, 'q'}, + 'q', NULL, "Generate relocations in final output", TWO_DASHES }, { {NULL, no_argument, NULL, '\0'}, 'i', NULL, NULL, ONE_DASH }, { {"just-symbols", required_argument, NULL, 'R'}, @@ -717,6 +719,9 @@ parse_args (argc, argv) lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0); break; case 'i': + case 'q': + link_info.emitrelocations = true; + break; case 'r': link_info.relocateable = true; config.build_constructors = false; |