[Bug 216316] objcopy (elfcopy) in 11 appears to have a regression compared to the version in 10

2021-01-31 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216316

--- Comment #10 from Michael Brown  ---
(In reply to Ed Maste from comment #8)

>From looking at elfcopy/binary.c and its create_binary() function: it appears
that elfcopy will use sh_offset to calculate the position within the final
binary file (rather than the LMA or even the VMA).  Since sh_offset is
meaningless once the ELF headers have been stripped away, this behaviour is
provably incorrect for anything other than extracting a single section via "-j
".

Building elfcopy from source confirms this behaviour from the current code.


So, we have three possible behaviours:

1. binutils objcopy

Uses the section LMA to determine the offset within the output file.  As above,
I would say that this behaviour is correct.

2. FreeBSD objcopy as present in binary distributions

Uses the section VMA to determine the offset within the output file.  As above,
I would say that this behaviour is wrong.

3. FreeBSD objcopy as built from source

Uses the section sh_offset to determine the offset within the output file. 
This behaviour is very definitely wrong.


I am puzzled why I get different behaviour from the FreeBSD binary and source
distributions, particularly since the use of sh_offset appears to have been
present since 2010.

Michael

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


Problem reports for toolch...@freebsd.org that need special attention

2021-01-31 Thread bugzilla-noreply
To view an individual PR, use:
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id).

The following is a listing of current problems submitted by FreeBSD users,
which need special attention. These represent problem reports covering
all versions including experimental development code and obsolete releases.

Status  |Bug Id | Description
+---+---
Open|234232 | clang Assertion failed when building the port dev 
Open|245179 | lld: wrong/misleading "SHF_MERGE section size mus 
Open|247665 | emulators/rpcs3: clang 10 crashes during build

3 problems total for which you should take action.
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"