Coder Social home page Coder Social logo

Comments (10)

rui314 avatar rui314 commented on July 1, 2024 1

objcopy indeed corrupted the ELF file because the tool created section symbols as absolute symbols, which doesn't make sense.

from mold.

marxin avatar marxin commented on July 1, 2024

FYI: @andreas-schwab

from mold.

rui314 avatar rui314 commented on July 1, 2024

Could you also share a.o?

from mold.

marxin avatar marxin commented on July 1, 2024

Sure:
a.o.tar.gz

from mold.

rui314 avatar rui314 commented on July 1, 2024

Does the above change work for you?

from mold.

marxin avatar marxin commented on July 1, 2024

Yes, it did.

Anyway, I don't think objcopy corrupted the ELF container, but instead the sections are in the opposite order if I compare objdump -s out/test/elf/x86_64/exception-multiple-ehframe/c.o before and after your change:

 Contents of section .note.gnu.property:
  0000 04000000 10000000 05000000 474e5500  ............GNU.
  0010 010001c0 04000000 01000000 00000000  ................
 Contents of section .eh_frame:
  0000 1c000000 00000000 017a504c 52000178  .........zPLR..x
  0010 10079b00 0000001b 1b0c0708 90010000  ................
  0020 24000000 24000000 00000000 5b000000  $...$.......[...
  0030 04000000 00410e10 8602430d 06458303  .....A....C..E..
- 0040 02510c07 08000000                    .Q......        
+ 0040 02510c07 08000000 00000000           .Q..........    
 Contents of section .eh_frame:
  0000 1c000000 00000000 017a504c 52000178  .........zPLR..x
  0010 10079b00 0000001b 1b0c0708 90010000  ................
  0020 24000000 24000000 00000000 5b000000  $...$.......[...
  0030 04000000 00410e10 8602430d 06458303  .....A....C..E..
- 0040 02510c07 08000000 00000000           .Q..........    
+ 0040 02510c07 08000000                    .Q......        
 Contents of section .gcc_except_table:
  0000 ff9b1101 082b0530 01390500 00010000  .....+.0.9......
  0010 00000000 ff9b1101 082b0530 01390500  .........+.0.9..
  0020 00010000 00000000                    ........        

from mold.

marxin avatar marxin commented on July 1, 2024

Can we please reopen it?

from mold.

andreas-schwab avatar andreas-schwab commented on July 1, 2024

sed is only guaranteed to work on text files.

from mold.

marxin avatar marxin commented on July 1, 2024

Can you try llvm-objcopy if it does the same?

from mold.

rui314 avatar rui314 commented on July 1, 2024

I'll use perl instead of sed to modify the binary files.

from mold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.