[Bug binutils/20751] New: Enhancement: make 'nm' to show symbol versions; improve documentation on symbol versions for 'objdump' and 'readelf'; (?) standardize version display format

2016-10-31 Thread sasha2048 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20751

Bug ID: 20751
   Summary: Enhancement: make 'nm' to show symbol versions;
improve documentation on symbol versions for 'objdump'
and 'readelf'; (?) standardize version display format
   Product: binutils
   Version: 2.26
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
      Reporter: sasha2048 at gmail dot com
  Target Milestone: ---

1. There is no support for displaying symbol version in 'nm'.
E.g. output of 'nm -D […]/libc.so.6' shows something like:
[…]
00143230 T realpath
000453c0 T realpath
[…]
which is pretty unclear.
I understand that it may be unreasonable to break current display format, but
introducing some new key like '--with-symbol-versions' would be nice.

2. While 'objdump' and 'readelf' are able to display symbol version, there is
no mention about it in documentation.
'man objdump' says: "After the section name comes another field, a number,
which for common symbols is the alignment and for other symbol is the size.
Finally the symbol's name is displayed." But when objdumping shared object with
symbol versions, 5th column is silently inserted between symbol size and symbol
name.
'readelf' displays names of symbols with version as 'symbol@version' or
'symbol@@version'. But there is no mention about that in documentation. Neither
about the fact of displaying version itself, nor about difference between '@'
and '@@'.

3. This point may be superfluous. But why not to make 'objdump' to display
version information in same way as 'readelf'? I.e. 'symbol@@version' and
'symbol@version' instead of 'version symbol' and '(version) symbol'.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/20751] Enhancement: make 'nm' to show symbol versions; improve documentation on symbol versions for 'objdump' and 'readelf'; (?) standardize version display format

2016-11-11 Thread sasha2048 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20751

--- Comment #3 from sasha1024  ---
Amazing! Thanks. I didn't expect it to be resolved so fast.

The only thing I'd add is:
--- a/binutils/doc/binutils.texi2016-11-11 14:24:37.868568232 +0200
+++ b/binutils/doc/binutils.texi2016-11-11 14:34:11.218934614 +0200
@@ -2628,7 +2628,10 @@

 The output format is similar to that produced by the @option{--syms}
 option, except that an extra field is inserted before the symbol's
-name, giving the version information associated with the symbol.
+name, giving the version information associated with the symbol (if
+version is the default version to be used when resolving unversioned
+references to the symbol then it's displayed as is, otherwise it's put
+into parentheses).

 @item --special-syms
 When displaying symbols include those which the target considers to be

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/20751] Enhancement: make 'nm' to show symbol versions; improve documentation on symbol versions for 'objdump' and 'readelf'; (?) standardize version display format

2016-11-11 Thread sasha2048 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20751

--- Comment #5 from sasha1024  ---
Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/24031] New: Cannot remove section related to a function (even if the function is in separate section and isn't referenced elsewhere)

2018-12-24 Thread sasha2048 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24031

Bug ID: 24031
   Summary: Cannot remove section related to a function (even if
the function is in separate section and isn't
referenced elsewhere)
   Product: binutils
   Version: 2.30
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: sasha2048 at gmail dot com
  Target Milestone: ---

Created attachment 11491
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11491&action=edit
Samples: file.c, file.s and file.o

Suppose, I have the following C-source file:

$ cat file.c
void f() {}
void g() {}

I can compile it to an object-file with the -ffunction-sections flag:

$ gcc -c -ffunction-sections file.c -o file.o

It corresponds to the following assembler code:

.file "file.c"
.text
.section .text.f,"ax",@progbits
.globl f
.type f, @function
f:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size f, .-f
.section .text.g,"ax",@progbits
.globl g
.type g, @function
g:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size g, .-g
.ident "GCC: (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0"
.section .note.GNU-stack,"",@progbits

Then I try to remove the .text.g section (with the g function) from object
file, I get the following error:

$ objcopy --remove-section .text.g file.o
objcopy: stReXCNA: symbol `.text.g' required but not present
objcopy:stReXCNA: No symbols

Is there reason why such task can't be performed by objcopy?

See also: https://stackoverflow.com/q/39873148

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils