Skip to content

Conversation

@quic-areg
Copy link
Contributor

@quic-areg quic-areg commented Sep 17, 2025

Binary files have no architecture flags, so the
default value of -1 is used instead of 0.

Fixes #396

Copy link

@jonathonpenix jonathonpenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @quic-areg!

@quic-seaswara
Copy link
Contributor

quic-seaswara commented Sep 17, 2025

ARM/AArch64 does not implement checkFlags

@quic-areg
Copy link
Contributor Author

ARM/AArch64 does not implement checkFlags

lld seems to not zero flags for binary inputs for Hexagon, Arm, AArch64 either so that should be ok

Copy link
Contributor

@quic-seaswara quic-seaswara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please zero the flags for all architectures, it does not make sense to not have the flags 0'ed for specific architectures.

$arm-none-eabi-ld.bfd -marmelf  --format=binary mydata.blob -o mydata.elf && llvm-readelf -h mydata.elf | grep Flags
  Flags:                             0x0

$aarch64-linux-gnu-ld.bfd -maarch64elf --format=binary mydata.blob -o mydata.elf && llvm-readelf -h mydata.elf | grep Flags
  Flags:                             0x0

Please compare bfd behavior at all times

@quic-areg quic-areg force-pushed the flags branch 3 times, most recently from 552b578 to 8c92cee Compare September 19, 2025 15:44
Copy link
Contributor

@quic-seaswara quic-seaswara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating seperate commits this way, I would appreciate if you could seperate each target specific change to a seperate commit or a PR.

Combining all of them together is making it hard to review.

Binary files have no architecture flags, so the default value of -1
is used instead of 0.

Also removes unused code in TargetInfo.h

Signed-off-by: quic-areg <aregmi@quicinc.com>
Signed-off-by: quic-areg <aregmi@quicinc.com>
@quic-seaswara
Copy link
Contributor

Please document this behavior in linker documentation

Copy link
Contributor

@parth-07 parth-07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@quic-seaswara quic-seaswara merged commit af9413b into qualcomm:main Sep 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eld seems to set e_flags to all 1s when --format=binary is used

4 participants