diff options
author | Jan Beulich <jbeulich@novell.com> | 2009-07-27 10:04:25 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2009-07-27 10:04:25 +0000 |
commit | efa19bfde4d57f33974cac17dfddb18f6f460f43 (patch) | |
tree | a54004628ab9a90b64e32ae145f1ff920d0eb5ee /gas/config/obj-elf.c | |
parent | 7859b21da558a842c9d35c3cae480e38204d9892 (diff) | |
download | gdb-efa19bfde4d57f33974cac17dfddb18f6f460f43.zip gdb-efa19bfde4d57f33974cac17dfddb18f6f460f43.tar.gz gdb-efa19bfde4d57f33974cac17dfddb18f6f460f43.tar.bz2 |
gas/
2009-07-27 Jan Beulich <jbeulich@novell.com>
* obj-elf.c (elf_file_symbol): Replace symbol name set up by
symbol_new() with the passed in, unmodified one.
gas/testsuite/
2009-07-27 Jan Beulich <jbeulich@novell.com>
* gas/elf/file.[ds]: New.
* gas/elf/elf.exp: Run new test.
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r-- | gas/config/obj-elf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index f85267b..51cd3a9 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -260,9 +260,20 @@ elf_file_symbol (const char *s, int appfile) || (symbol_rootP->bsym->flags & BSF_FILE) == 0) { symbolS *sym; + unsigned int name_length; sym = symbol_new (s, absolute_section, 0, NULL); symbol_set_frag (sym, &zero_address_frag); + + name_length = strlen (s); + if (name_length > strlen (S_GET_NAME (sym))) + { + obstack_grow (¬es, s, name_length + 1); + S_SET_NAME (sym, obstack_finish (¬es)); + } + else + strcpy ((char *) S_GET_NAME (sym), s); + symbol_get_bfdsym (sym)->flags |= BSF_FILE; if (symbol_rootP != sym) |