diff options
author | Alan Modra <amodra@gmail.com> | 2000-07-08 13:35:05 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2000-07-08 13:35:05 +0000 |
commit | 227aeb075891eaf16367ca6dffc9967a326fb3c6 (patch) | |
tree | 429c03e6c86409dd577f3dd5cad8233ca96c9517 | |
parent | 52b219b5e48eea63fde7bff994824f5d87a8e1f5 (diff) | |
download | gdb-227aeb075891eaf16367ca6dffc9967a326fb3c6.zip gdb-227aeb075891eaf16367ca6dffc9967a326fb3c6.tar.gz gdb-227aeb075891eaf16367ca6dffc9967a326fb3c6.tar.bz2 |
Fix --section-start=xxxx
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/lexsup.c | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 1965b47..4109d25 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2000-07-08 Alan Modra <alan@linuxcare.com.au> + + * lexsup.c (parse_args): Copy section name. + 2000-07-07 Charles Wilson <cwilson@ece.gatech.edu> * ld/emultempl/pe.em: institute the following search order for diff --git a/ld/lexsup.c b/ld/lexsup.c index 2869d49..a018f28 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -847,6 +847,8 @@ parse_args (argc, argv) case OPTION_SECTION_START: { char *optarg2; + char *sec_name; + int len; /* Check for <something>=<somthing>... */ optarg2 = strchr (optarg, '='); @@ -869,12 +871,15 @@ parse_args (argc, argv) xexit (1); } - optarg2[-1] = '\0'; + /* We must copy the section name as set_section_start + doesn't do it for us. */ + len = optarg2 - optarg; + sec_name = xmalloc (len); + memcpy (sec_name, optarg, len - 1); + sec_name[len - 1] = 0; /* Then set it... */ - set_section_start (optarg, optarg2); - - optarg2[-1] = '='; + set_section_start (sec_name, optarg2); } break; case OPTION_TBSS: |