bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/27314] objcopy overwrite sections


From: hjl.tools at gmail dot com
Subject: [Bug binutils/27314] objcopy overwrite sections
Date: Tue, 02 Feb 2021 18:36:05 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27314

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
I don't think you can use "objcopy -O binary" on relocatable object
since all sections are copied to offset 0:

[hjl@gnu-cfl-2 pr27314]$ cat foo.s
        .text
        .section        .rodata
        .string "This is a test"
        .text
        .globl  foo
        .type   foo, @function
foo:
        pushq   %rbp
        movq    %rsp, %rbp
        nop
        popq    %rbp
        ret
        .size   foo, .-foo
[hjl@gnu-cfl-2 pr27314]$ make
as -mx86-used-note=no  -o foo.o foo.s
./objcopy -O binary foo.o foo.bin
hexdump -C foo.bin
00000000  54 68 69 73 20 69 73 20  61 20 74 65 73 74 00     |This is a test.|
0000000f
[hjl@gnu-cfl-2 pr27314]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]