Install of elf file through base-files mechanism alters elf executable content

Forums General Install of elf file through base-files mechanism alters elf executable content

Viewing 1 reply thread
  • Author
    Posts
    • #15455
      c spenglerc spengler
      Participant

        I am adding in a elf file to run on our M4 in our custom 157F board through a
        base-files_%.bbappend file. In the append I specify the sha256 sum of the elf file:

        SRC_URI_append = “file://configDefault.json \
        file://m4-images/M4_1.2.11_CZ.elf;sha256sum=225c4f5d8f45ad7c4c7e463af74555472a02c53cf529df2728d7292922fa8d74 \

        and later in the do install:
        do_install_append(){
        #   echo “======= ${PN}-${PV} INSTALLING opt stuff  ========”
        install -m 0755 -d ${D}/opt
        install -m 0755 -d ${D}/opt/Blah
        install -m 0755 -d ${D}/opt/Blah/moreBlah
        install -m 0755 -d ${D}/opt/Blah/moreBlah/firmware

        install ${S}/m4-images/M4_1.2.11_CZ.elf ${D}/opt/Blah/moreBlah/firmware
        }

        (The names have been changed to protect the guilty)

        When I boot the sd card image I find the file is where I expect it but it’s sha256 sum is different. When I extract the file and use dhex to compare the file to the original file it is very different in a few
        places. Anyone know why this is happening? Is this a TFA build behavior (cause we aren’t using the TFA suff)? I have not  tried to run the resulting installed M4 image as I have no idea what it may actually do…

      • #15497
        Neeraj Dantu
        Moderator

          C spengler,

          It seems like Yocto does stuff to binaries: https://docs.yoctoproject.org/dev/dev-manual/prebuilt-libraries.html. May be yocto is stripping the elf file when it is packaging?

          There should be log files associated with each recipe as described here: https://docs.yoctoproject.org/dev-manual/new-recipe.html#running-a-build-on-the-recipe.

          Best,

          Neeraj

      Viewing 1 reply thread
      • You must be logged in to reply to this topic.