This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: patch : aix ppc partial link fix
- To: Tom Rix <trix at redhat dot com>
- Subject: Re: patch : aix ppc partial link fix
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Tue, 14 Aug 2001 10:29:34 +0930
- Cc: binutils at sources dot redhat dot com
- References: <3B6B07D2.D6EC517A@redhat.com>
On Fri, Aug 03, 2001 at 03:21:38PM -0500, Tom Rix wrote:
> + *relocation = val + addend;
> + *relocation -= (input_section->output_section->vma +
> + input_section->output_offset);
Formatting. Break a line before an operator.
> + *relocation = ((val - xcoff_data (output_bfd)->toc) -
> + (sym->n_value - xcoff_data (input_bfd)->toc));
Again.
> + if (NULL != h &&
> + bfd_link_hash_defined == h->root.type &&
> + (rel->r_vaddr - input_section->vma + 8 <= input_section->_cooked_size)) {
Again. Put brace on next line too.
> + if (h->smclas == XMC_GL ||
> + strcmp (h->root.root.string, "._ptrgl") == 0) {
Similarly.
> + if (next == 0x4def7b82 || /* cror 15,15,15 */
> + next == 0x4ffffb82 || /* cror 31,31,31 */
> + next == 0x60000000) /* ori r0,r0,0 */
> + bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */
Trailing operators. Also best for readability to separate the body of
an `if' from a multi-line condition with braces.
> + } else {
Braces and `else' on separate lines.
> + } else if (NULL != h && bfd_link_hash_undefined == h->root.type) {
Again, put braces on separate lines. `else if' is OK on one line.
> + overflow checking. */
Two spaces after period.
> + *relocation -= (input_section->output_section->vma +
> + input_section->output_offset);
Trailing operator.
> + *relocation -= (input_section->output_section->vma +
> + input_section->output_offset);
Again.
> + static boolean (*calc_relocation[RS6000_MAX_RELOC_TYPE])
> + (bfd *input_bfd, asection *input_section, bfd *output_bfd,
> + struct internal_reloc *rel, struct internal_syment *sym,
> + struct reloc_howto_struct *howto, bfd_vma val, bfd_vma addend,
> + bfd_vma *relocation, bfd_byte *contents) = {
This is one place where the brace on the same line is correct. Putting it
on the next line leads to emacs auto-formatting moving it to the first
column, which should only have braces for the start of a function.
> ! which may be changed to a load. The PowerOpen ABI says
> ! this is the same as R_POS.
> ! */
Strictly speaking, the comment should end "R_POS. */"
Please check for similar formatting errors in the rest of your patch.
There are many more. See http://www.gnu.org/prep/standards_toc.html
Alan Modra